VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: TR mediendesign on January 15, 2026, 19:12:36 PM

Title: Virtuemart category pagination not working
Post by: TR mediendesign on January 15, 2026, 19:12:36 PM
Hi,

I got a strange problem, that also appears on the Virtuemart demo:

https://demo.virtuemart.net/hurlex-shop/t-shirts.html

If you open this page and set the number of shown products to "3", the pagination will be shown. There are 3 products on the first page and 1 on the second page. If you navigate to the second page, the single product will be shown. However, it is not possible to go back to the first page again. The shop stays on the second page permanently.

If you have more pagination items like here

https://www.holz-liebe.de/holz-liebe-shop/miniaturwerkstaetten/malermaurer.html

you can navigate to page 2, 3, 4, etc. and navigate between them properly, but it is not possible to go back to the first page again. It happens in multiple shops, the demo page, etc. A fix would be very appreciated.

I am using Joomla 5.4.2 and VirtueMart 4.6.6.


Kind regards,
Tobias
Title: Re: Virtuemart category pagination not working
Post by: patbe60 on January 19, 2026, 14:20:39 PM
Same problem here. The pagination doesn't go back to the first page.

Joomla 5.4.2 and VirtueMart 4.6.6

EDIT: When changing the number of products per page it works once (only the first time going back to page 1) but after the problem appears again.
Title: Re: Virtuemart category pagination not working
Post by: patbe60 on January 19, 2026, 14:45:31 PM
I have found a working solution here in the forum:

https://forum.virtuemart.net/index.php?topic=152434.msg544487#msg544487
Title: Re: Virtuemart category pagination not working
Post by: TR mediendesign on January 20, 2026, 15:57:22 PM
Hello patbe60,

if I add this fix to the router, the pagination works again and adds "results,1-10" to the URL, but if you open the category again from the shop pages the same problem occurs. If there is no "results..." in the URL it is not working and shows the previously opened sub page products.

Kind regards,
Tobias
Title: Re: Virtuemart category pagination not working
Post by: patbe60 on January 21, 2026, 12:11:05 PM
Quote from: TR mediendesign on January 20, 2026, 15:57:22 PMHello patbe60,

if I add this fix to the router, the pagination works again and adds "results,1-10" to the URL, but if you open the category again from the shop pages the same problem occurs. If there is no "results..." in the URL it is not working and shows the previously opened sub page products.

Kind regards,
Tobias

I checked your site but can't replicate the problem. Everything seems to work fine.
What do you mean with "open the category again from the shop pages"?
Title: Re: Virtuemart category pagination not working
Post by: TR mediendesign on January 21, 2026, 12:27:09 PM
Hi,

if you open this page

https://www.holz-liebe.de/holz-liebe-shop/miniaturwerkstaetten/malermaurer.html

and navigate to page 2, 3 or 4 you can see the correct products. But if you go back to the main shop page

https://www.holz-liebe.de/holz-liebe-shop.html

and open "Miniaturwerkstätten" and afterwards the category "Maler & Maurer", you see the products from the previoiusly opened pagination page, instead of the products 1-10 from the first page.

In the "default" category page URL there is no "results,1-10" and it does not show the first 10 products.

Kind regards,
Tobias
Title: Re: Virtuemart category pagination not working
Post by: patbe60 on January 21, 2026, 13:18:16 PM
Okay, I see now what you mean. The problem with the pagination started with version 4.6.0 and is not solved until now.
The proposed solution by Jumbo! helps but is not the final solution. The problem you mentioned in your last post remains.

But at least you can now access the first page.
Title: Re: Virtuemart category pagination not working
Post by: TR mediendesign on January 22, 2026, 10:05:02 AM
Yes, that's correct. It works as a workaround for now, but a final solution would be highly appreciated.
Title: Re: Virtuemart category pagination not working
Post by: patbe60 on January 22, 2026, 13:35:26 PM
This is the solution (components/com_virtuemart/router.php at about line 495):

$limitstart = intval($limitstart);

                $limit = intval($limit);

                if ( $limitstart>0 ) {

replace with

$limitstart = intval($limitstart);

                $limit = intval($limit);

                if ( $limitstart>=0 ) {

Title: Re: Virtuemart category pagination not working
Post by: TR mediendesign on January 23, 2026, 16:17:51 PM
That seems to work for now. Thanks!