Pagination issue

  • Posts: 5
  • Thank you received: 0
5 years 9 months ago #295304

-- HikaShop version -- : 3.5.0
-- Joomla version -- : 3.8.8
-- PHP version -- : 5.4
-- Browser(s) name and version -- : Google Chrome 67.0.3396.99

In the Categories listing, if I have more than 20 products, the pagination is visible at the bottom of the page, and I noticed that the link for the 2nd page (and all the others, actually) are not working properly...

What I see in the URL after clicking in the second page link is the following:

<URLOfThePage>?limitstart=20"%20onclick="javascript:%20var%20f%20=%20document.forms[

I managed to track the issue to the pagination file: "administrator/components/com_hikashop/helpers/pagination.php"
Inside the definition "HK_item_active", I see this:
array($this->_link($b)."\" onclick=\"var f = document.forms['adminForm".$this->hikaSuffix.$this->form."']; f.limitstart".$this->hikaSuffix.".value=".$b."; f.submit();return false;"),


It seems to me that only this would be enough:
array($this->_link($b)),

With what I think could be enough, I get the following URL when clicking on the link for the second page:
<URLOfThePage>?limitstart=20

I would like to confirm if this is a bug or not.
If it is not a bug, why is the url containing javascript code?

Best regards,
Victor

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
5 years 9 months ago #295306

I found out that the template I was using had the character ' and " permuted when returning the value from the definition "pagination_item_active"

This doesn't work with Hikashop

    return "<li><a class='" . $cls . "' href='" . $item->link . "' title='" . $item->text . "'>" . $item->text . "</a></li>";

This DOES work with Hikashop
    return '<li><a class="' . $cls . '" href="' . $item->link . '" title="' . $item->text . '">' . $item->text . '</a></li>';

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
5 years 9 months ago #295322

Hi,

It is not a bug in HikaShop. It is a bug in the way the pagination is handled in the template.
Rename the file templates/YOUR_TEMPLATE/html/pagination.php in order to use the default pagination of Joomla, or switch to the default template of Joomla which has a pagination.php override and you'll see that in both case, it works fine.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
5 years 9 months ago #295334

Yeah, I know that now :)
After posting the first comment, I found out that the problem was in the template I'm using.
I changed the template and it's working fine now.

Thank you for the quick response, though. :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum