Pagination on front end is not working 100% - can't get back to page 1

Started by _stu, October 13, 2022, 23:34:10 PM

Previous topic - Next topic

_stu

Sorry this is a duplicate post. Wasn't sure whether to open a new one or add to the request to test routing (http://forum.virtuemart.net/index.php?topic=148823.msg531738#msg531738)

I still have an issue with pagination - I can't get to the first page of products once I leave it. This occurs on category layouts that display subcategories and all products in subcategories, such as the top level category. Category layouts that display only products in the category (no subcategory products) work correctly; I can get to all pages.

Details:

  • Joomla 4.2.3
  • VM com_virtuemart.4.0.7.10720_package (12OCT2022
  • PHP 8.0
  • Joomla SEF is on

Troubleshooting:

  • SEF URL for page 1 is always .../online-ordering-payment.html. The first time I go to this page, it gives me the first page of products. After leaving the first page, this URL sends me to the last page I was on, even if I go outside the shop and return.
  • SEF URL for other pages is, for example, .../online-ordering-payment/results,25-48.html?clearCart=0
  • If I manually enter URL .../online-ordering-payment/results,1-24.html?clearCart=0, I can get back to page 1.
Digging in to the debug, I see that when going back to page #1, parseRoute($segments) function does not get called. It does get called when initially going to page 1 and every time you go to another page. It appears that it's only skipped when returning to page 1.
This results in the $segments variable not being set to
Array
(
    [ 0 ]   => results,1-0
)


Additionally, and I'm not sure whether it's related or not, I see that $limitstart doesn't get set when returning to page 1. It is set to 0 when initially going to page 1 and to 10 (for example) when going to page 2, but when returning to page 1, it is null.
Note that I'm not very confident in this last statement, because the buildRoute(&$query) function, where $start, $limit, and $limitstart are set, is called multiple times one one page, each time with different results (category, itemid, cart, etc.).

Conclusion: Pagination appears to be almost fixed, except for product in categories that include products in subcategories.
This bug (http://forum.virtuemart.net/index.php?topic=148574.msg531414#msg531414) still seems to be alive.

Hope this helps to determine how to fix the issue. My PHP skills are not sufficient to solve this one.

theictshak

Hi All
I am also having this issue. 
Anyone worked out a solution for this as yet.
Am using VirtueMart 4.0.12 10777 and Joomla 4.2.9
Thanks in advance
Cheers
Margaret

niosme

You can use my customized version which works with php 8 ( if you install it in joomla 4 apply the overrides on the new virtuemart administrator template) to make it work with php8 in administrator without errors.In joomla 3 overrides applied by default.
Also fixed router problems and some common problems etc.
Or if you dont want to install it just replace the router file in frontend with the attached one.

CUSTOMIZED INSTALLABLE VERSION: https://www.mediafire.com/file/1v1xtomlrf4n7g3/com_virtuemart.4.0.12.10777_package_or_extract_CUSTOMIZED_LAST.zip/file
OR
ROUTER FILE IS ATTACHED you have to unzip it first and replace it at components/com_virtuemart/router.php

Its kinda funny there are childish bugs and problems like this. Suggest not upgrading to latest version till it become stable like wait a year before upgrading and maybe more.This will prevent you from loosing customers as i saw on other posts.
This is my opinion cause i cannot trust Milbo's updates and code.This is something happening from the start of virtuemart.Also there other free solutions that anyone can follow from now and on which they are bug free and not telling about wp ofc.
Fullstack Developer and Joomla Expert