VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ahmedfouad on October 13, 2018, 18:03:12 PM

Title: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 13, 2018, 18:03:12 PM

I'm having very persisting pagination problem I don't figure out how to solve it.
I searched the forum and Google for solutions for many days no luck
The problem is some times in the categories display page 2 appear first instead of page 1 any help will be appreciated Thanks.
Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 13, 2018, 19:46:36 PM
at least live urls and urls to see the problem

switch off  SEF to test
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 13, 2018, 22:58:48 PM
Thank you for your reply
Here it is
https://tajr.shop/ar/shop/gemstones

and here a photo to the problem
https://app.box.com/s/2shnvzg0uxgksrszc8isragzyv0z57fs
Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 14, 2018, 10:55:56 AM
I don't see any pagination problems .. examples? urls? screenshots?
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 14, 2018, 12:54:26 PM
Virtuemart category preview should display the first page if URL like this pressed
https://tajr.shop/ar/shop/gemstones
But instead some times I find the (second) page displayed instead when the same URL pressed
https://tajr.shop/ar/shop/gemstones

Screen shot
https://app.box.com/s/2shnvzg0uxgksrszc8isragzyv0z57fs

Here is a video about this problem because it's happen occasionally

https://youtu.be/HC68qqBAshA

The problem is in this case the second page cached in (Litespeed cache component) based on the URL witch is

https://tajr.shop/ar/shop/gemstones

And then distributed to all visitors,  I talked to the developers of litespeed cache about this and they reported that this problem happens with or without cache hits so it's not a litespeed cache problem.

Thank you for your time  :)

Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 14, 2018, 13:47:58 PM
I tried these urls and I only ever see the 1st page

But if u sometimes see the second page then I can totally believe it is a caching issue ..
U can't cache everything ---  sometimes it is going to get it wrong
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 16, 2018, 00:00:34 AM
I tested my web site locally and done the following :

1- Disabled SEF URL of Joomla
2- Change the template
3- Uninstalled all extensions except the default Joomla extensions and Virtuemart
4- Updated Joomla and Virtuemart to the latest VER
4- Installed New Joomla and virtuemart installations in sub folder to compare settings (package downloaded from Virtuemart website containing Joomla and virtuemart)

With all this done my website acted locally as the following:

Step 1: when I press in to enter a category I see page one as normal and wen I navigate to page 2 every thing works fine
Step 2: I go to the home page of the store and returned to the same section at this case I don't see page one I see page 2
Step 3: In New Clean  installation (package downloaded from Virtuemart website containing Joomla and virtuemart)
Virtuemart acted differently as the same steps repeated no matter the page I was on when I return to the main page of section I see page one.
What could be the cause of that and how I can fix IT.
Thanks.
Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 16, 2018, 11:19:54 AM
just tried this multiple times

QuoteStep 1: when I press in to enter a category I see page one as normal and wen I navigate to page 2 every thing works fine
Step 2: I go to the home page of the store and returned to the same section at this case I don't see page one I see page 2

I always land on page 1 with 12 products - not https://tajr.shop/en/shop/gemstones/rosary?start=12

must be your browser?
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 16, 2018, 17:48:35 PM
Thank you for your time and support.
I clear the browser data before any testing.
I'm Currently still using Lightingspeed cache with cache live time (1) hour so if the pages already cached and generated (correctly and some times it's not) the problem will not appear.
If you please test the same steps mentioned earlier (I'm so sorry for your troubles :) ) in this demo it's identical to my site and the same result's I get in my local hosting happens in this demo also.

Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 16, 2018, 19:18:44 PM
the example above does indeed load the 2nd page ( but without ?start=12) if i go

mens
mens page 2
home
mens // this is the mens url but with product 13-17

so can only be your caching .. is the site so slow/bad without it?
I rarely use any sort of caching on my sites -- I prefer to have a decent host/server/template/code that doesn't require caching to achieve acceptable results
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 17, 2018, 18:33:43 PM
Quote from: GJC Web Design on October 16, 2018, 19:18:44 PM
the example above does indeed load the 2nd page ( but without ?start=12) if i go

mens
mens page 2
home
mens // this is the mens url but with product 13-17



And this is exactly my problem if Litespeed cache the second page on main category URL without ?start=12.

This Demo site from Joomlart company website My guessing that they are using stranded Joomla cache and even without any caching in local hosting the same behavior happens.

Yes the site have good performance without caching but with cache the site ability to handle traffic triples so it's huge advantage.
I was wondering if there is any solution for that kind of behavior without discarding caching.
Note (Test in localhost without any caching):
If I deleted the site cookies (With the category main URL loading the second page) and refreshed the main category URL loads the first page normally.
Title: Re: Pagination problems in VM 3.2.2
Post by: GJC Web Design on October 17, 2018, 18:36:15 PM
enable the Joomla debug

then at the bottom you can study the session info .. clearing the cookies just disconnects the session .. nothing will be stored in a cookie but something may be seen in the session that gives you some clue
Title: Re: Pagination problems in VM 3.2.2
Post by: ahmedfouad on October 17, 2018, 18:42:02 PM
Thank you very much for your Time I Will give it a try.
Title: Re: Pagination problems in VM 3.2.2
Post by: 0racle on June 06, 2019, 11:35:06 AM
Open /components/com_virtuemart/router.php file and replace the code in line 140:


} else if ( $start>0 ) {


with the code:


} else if ( $start>=0 ) {