News:

Support the VirtueMart project and become a member

Main Menu

Problem with pagination and sorting [vm 4.0.20]

Started by hazael, May 05, 2023, 14:40:31 PM

Previous topic - Next topic

T.A. Garrison, LLC

Something has definitely changed in VM 4.4.1 11099 along with Joomla 5.2.1

I tried the original code from Hazael as well as the remove 'GET' as mentioned by yaniv1, and neither of the options worked.

Obviously there is still something conflicting - or ?? - somewhere. But it's not working for me.
T.A. Garrison, LLC
3150 Orleans St. # 28261
Bellingham, WA 98228

hazael

#16
This code will not work properly - SEF Links will be generated incorrectly.
echo $this->vmPagination->getPagesLinks();

This variable when calling for the first time, it generates incorrect pagination links. However, calling it a second time fixes the issue.

Cause:
VirtueMart dynamically generates pagination data on the first call, meaning the links may not be fully initialized until after the first execution.

Solution:
To ensure correct pagination links, store the result in a variable before using it.

In you template: /com_virtuemart/category/default.php

This solution will work correctly - the SEF links will generate correctly
$this->vmPagination->getPagesLinks(); // Trigger pagination generation
$pagination = $this->vmPagination->getPagesLinks(); // Retrieve correct links
echo $pagination;