News:

Support the VirtueMart project and become a member

Main Menu

Category Pagination Bug and suggested Solution

Started by sscheidegger, March 08, 2012, 12:04:06 PM

Previous topic - Next topic

sscheidegger

Hi all

I found the following bug in VM2.0.2 and J2.5.1: In some situations the category view shows no products. The error can be reproduced for example when:
- The limit of products per page is set to 10
- There is a category A with EXACTLY 10 products
- There is at least one category B with more than 10 products (i.e. 25)
- In the FE, go to category B and visit the second page of products (i.e products 11-20)
- Then visit category A
--> The category shows no products

Suggested solution: In vmmodel.php change line 446 form
if($limitStart>$count){
to
if($limitStart>=$count){



Another question about this topic: If I browse to page two of a category and then I visit some other category with multiple pages, it shows automatically page 2. I find this behaviour a little confusing. Could this maybe  be changed so that for other category it starts at page 1 again?

Thanks,
Stefan

Milbo

Is added

question 2: yes I planned it already. thx for the hint now I have an idea, how to solve it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

basile

Quote from: Milbo on March 08, 2012, 13:39:00 PM
Is added

question 2: yes I planned it already. thx for the hint now I have an idea, how to solve it.

How did you solve the second question?

Milbo

I lost a bit track of this, but imho the 2.0.7a should work better. Maybe only without sef, or only with sef, there was something not finished. Would be good to have a nice detalied report about this.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

basile

I solved the problem by adding directly to the database in the menu table the &limitstart=0 at the end of the menu url.
Now when I go to page 4 of a product and then click on the menu to move to another product I'm redirected to the page 1 of the new selected product. Good.
I use a joomla menu pointing to virtuemart product categories.
When I add in a joomla menu a virtuemart product category, what modification sould be done in order to add at the end of the menu link: '&limitstart=0' ?
For example:
index.php?option=com_virtuemart&view=category&virtuemart_category_id=3
index.php?option=com_virtuemart&view=category&virtuemart_category_id=3&limitstart=0

This will solve the pagination problem