Pagination not correct after changing limit

  • Posts: 192
  • Thank you received: 71
  • Hikashop Business
1 week 3 days ago #315490

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.15

Hi,

we noticed when changing the number of products displayed in a listing, the pagination buttons do not seem to be correct when you are on a different page than the first page.

You can also see this on the Hikashop Demo website by following these steps:
1. In the backend, we created some more products to have a few more pages of products.
2. On the frontend go to Products Listing -> Display in List
3. Eight products are displayed. Go to a next page, e.g. page 2.
4. Now change the number of products displayed from 8 to e.g. 16
5. The webpage will display 16 products and move back to page nr. 1
However, all links to the other pages are now incorrect.

If you check the links, they are all limitstart=8 while it should be limitstart=16, limitstart=32, limitstart=48, etc.
This goes wrong every time a user is on any page > 1 and changes the limit.
We hope this can be fixed asap.
Thanks.

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

  • Posts: 68132
  • Thank you received: 10158
  • MODERATOR
1 week 2 days ago #315516

Hi,

Download the install package on our website and install it on yours and it will add a patch for that.

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

  • Posts: 192
  • Thank you received: 71
  • Hikashop Business
1 week 2 days ago #315530

Hi,

hmm, we updated to the latest install package 4.2.2 [2002031612] and got rid of any overrides, but still doesn't appear to be working, we don't see any change.

Did you test by following our steps in the first post?
If you go to any page other than the first page and change the nr. of products displayed, then all the pagination buttons are wrong and they're all identical with the same "limitstart".

Thanks for looking into it.

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

  • Posts: 12306
  • Thank you received: 1696
  • MODERATOR
1 week 1 day ago #315559

Hello,

I wasn't able to reproduce it on my end. Can you send us a temporary back-end access to your website so that we can directly test it ?
You can send it using our contact form, by specifying a link to that thread in your message :
www.hikashop.com/support/contact-us.html

Kind regards,
Mohamed Thelji.

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

  • Posts: 192
  • Thank you received: 71
  • Hikashop Business
1 week 1 day ago #315575

Hi,

our live website is not exactly suitable for testing, we'll see if we can set up a separate test-website when we have time.
However, I think you can test on your own Hikashop Demo website because you can also see the exact same thing happening there.

Just follow the steps in our first post on the Demo website and you will see the pagination buttons are not correct after changing the number of products displayed in a listing. That is precisely also what happens on our website.

Attachments:

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

  • Posts: 12306
  • Thank you received: 1696
  • MODERATOR
1 week 2 hours ago #315605

Hello,

We succeed to reproduce it on our end thanks to your instructions. to fix it you'll just have to edit the file "administrator\components\com_hikashop\helpers\pagination.php" and change that line :

$current_url = str_replace(array('limitstart'.$this->hikaSuffix.'='.$old_start, 'limitstart'.$this->hikaSuffix.'-='.$old_start), array('limitstart'.$this->hikaSuffix.'='.$start, 'limitstart'.$this->hikaSuffix.'-'.$start), $current_url);

By:

$current_url = preg_replace('#limitstart'.$this->hikaSuffix.'(=|-)[0-9]+#','limitstart'.$this->hikaSuffix.'${1}'.$start, $current_url);


Thank you for your feedback !
Kind regards,
Mohamed.

The following user(s) said Thank You: GW

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

  • Posts: 192
  • Thank you received: 71
  • Hikashop Business
4 days 23 hours ago #315690

Hi,

the above edit has fixed the initial error, however we now notice changing the nr. of products per page and pagination goes wrong when in combination with filters.

Unfortunately the Hikashop Demo website doesn't have filters, but I think it is fairly easy to reproduce:

1. Apply a filter on a product listing, e.g. a color, size, whatever
2. Change the number of products displayed per page, e.g. from 8 to 16
It will display 16 products, but all pagination buttons are now wrong.

We can see this is because as soon as a filter is applied, there is never any "limit" parameter added to the pagination URL's and the browser therefore won't remember the nr. of products displayed. So the "limitstart" is ok, but the "limit" is missing and therefore it will always revert back to displaying 8 products.

Hopefully this can also be fixed, thanks.


EDIT: As an additional note, this only happens with "Redirect POST mode" set to "Yes", but for us it is quite important to keep this set to Yes.
Also, we found this actually doesn't have anything to do with filters, it is just because as soon as the "limitstart=0" is already present in the URL then things go wrong and the "limit" parameter never gets added.

Last edit: 4 days 22 hours ago by GW.

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

  • Posts: 12306
  • Thank you received: 1696
  • MODERATOR
4 days 1 hour ago #315711

Hello,

EDIT: As an additional note, this only happens with "Redirect POST mode" set to "Yes", but for us it is quite important to keep this set to Yes.
Also, we found this actually doesn't have anything to do with filters, it is just because as soon as the "limitstart=0" is already present in the URL then things go wrong and the "limit" parameter never gets added.

Thank you for these information, we'll try to reproduce and fix it on our end and get back to you as soon as possible.

Kind regards,
Mohamed.

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

  • Posts: 12306
  • Thank you received: 1696
  • MODERATOR
1 day 6 hours ago #315773

Hello,

After a lot of testing I wasn't able to reproduce it on my end with or without the "redirect POST mode" set to yes.
Can you give us a temporary access to your website back-end and FTP so that we can directly test and debug it on your website ? Thank you.
You can send it using our contact form and by specifying a link to that thread in your message :
www.hikashop.com/support/contact-us.html

Kind regards,
Mohamed.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum