VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: cre8iv_dzine on November 27, 2012, 20:49:11 PM

Title: Limitstart on categories - Cannot get back to page one
Post by: cre8iv_dzine on November 27, 2012, 20:49:11 PM
I'm having a problem with the link that involves "limitstart" on my site.

If you put the limit per page down to 3 (or any number that doesn't list everything on one page). If you go to any page besides 1, you cannot get back to page one because the link is incorrectly programmed.

So, to clear this up, if I go to page 2 on my vmpagnation bar, it goes to this link
/index.php?option=com_virtuemart&view=category&virtuemart_category_id=3&Itemid=101&limitstart=3

Go to page 3 and it goes here
/index.php?option=com_virtuemart&view=category&virtuemart_category_id=3&Itemid=101&limitstart=6

However, if I click on page 1, the link goes to this
/index.php?option=com_virtuemart&view=category&virtuemart_category_id=3&Itemid=101
The limitstart is left off and you remain on whatever page you were on.

The link is SUPPOSED to go to
/index.php?option=com_virtuemart&view=category&virtuemart_category_id=3&Itemid=101&limitstart=0

Unfortunately, I don't know enough about PHP programming to fix this myself

I believe the fix for it is in this file
/administrator/components/com_virtuemart/helpers/vmmodel.php
But I'm not 100% sure.

Any help anyone could give me, would be a big help
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: bytelord on November 27, 2012, 21:45:45 PM
Hello,

Please follow this: http://forum.virtuemart.net/index.php?topic=109043.0

If doesn't work try this: http://forum.virtuemart.net/index.php?topic=104709.msg364194#msg364194

Regards
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: cre8iv_dzine on November 27, 2012, 22:04:50 PM
http://forum.virtuemart.net/index.php?topic=109043.msg365147#msg365147

I can't find the "category configuration" the version I'm using is 2.0.14
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: bytelord on November 27, 2012, 22:12:24 PM
??
From the backend Go to Prosuct -> Product Categories -> Select a category ... this is the category configuration ...

Regards
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: cre8iv_dzine on November 27, 2012, 22:21:41 PM
I set them all to 0 and I'm still having the same issue.

The link is basically the only problem. If "page 1" linked to "limitstart=0" it would work. I've tested this by going to this page manually and the page comes up without issue.

I appreciate the help, but neither fix you sent worked
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: bytelord on November 27, 2012, 22:28:49 PM
and this? http://forum.virtuemart.net/index.php?topic=104709.msg364194#msg364194

Are you sure you have configured properly? Did you clean your browser cache?
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: cre8iv_dzine on November 27, 2012, 22:40:33 PM
Yes, I tried a couple of things, because later down that forum post you said it was fixed in the newest version (2.0.14) which is what I'm using.

This is my code from line 549 to 569

$category = $catModel->getCategory();
if(empty($limit)){
if(!empty($category->limit_list_initial)){
$suglimit = $category->limit_list_initial;
} else {
if(empty($category->limit_list_step)){
$suglimit = VmConfig::get ('list_limit', 20);
} else {
$suglimit = $category->limit_list_step;
}
}
if(empty($category->products_per_row)){
$category->products_per_row = VmConfig::get ('products_per_row', 3);
}
$rest = $suglimit%$category->products_per_row;
$limit = $suglimit - $rest;
$prod_per_page = explode(",",VmConfig::get('pagination_sequence'));
if($limit <= $prod_per_page['0'] && array_key_exists('0',$prod_per_page)){
$limit = $prod_per_page['0'];
}
}



And yes, I've cleared my browser cache and my DNS resolver cache for good measure
Title: Re: Limitstart on categories - Cannot get back to page one
Post by: cre8iv_dzine on November 28, 2012, 00:05:16 AM
let me know if anyone else knows a solution to this