VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: Thomas Kuschel on April 17, 2012, 15:22:48 PM

Title: Pagination shows only 6 items or the count of former used menu entry
Post by: Thomas Kuschel on April 17, 2012, 15:22:48 PM
Hello,
I found a very annoying side effect with pagination of the product's category view.
Description:
Every time when I navigate through my website, through different menus, and afterwards clicking to the virtuemart menu entry - the categories are shown. But then, after clicking into any category, only 20, or 6, or 10 product items are shown.
It depends on the menu where I navigated before! The value "# Intro" of the Parameters of the e.g. Category Blog Layout sets this default value... That's a side effect.
Inside each product category form, you can configure the  parameters Category Form Limit List Max, etc. via Backend - But that doesn't matter if this "#Intro" value is lower.
Within my template, this was very annoying, because I have hidden the "results" selection box on the right upper side. And I wanted to show all devices without pagination.

Does anyone have the same error?

After some debugging, I found a solution - but I'm not sure if this is the most suitable one.
Inside /components/com_virtuemart/router.php line 583 I changed the code from
if (! array_key_exists ($instanceKey, self::$_instances)){
self::$_instances[$instanceKey] = new vmrouterHelper ($instanceKey,$query);

if (self::$limit===null){
$mainframe = Jfactory::getApplication(); ;
self::$limit= $mainframe->getUserStateFromRequest('global.list.limit', 'limit', VmConfig::get('list_limit', 20), 'int');
}
}
return self::$_instances[$instanceKey];

to
if (! array_key_exists ($instanceKey, self::$_instances)){
self::$_instances[$instanceKey] = new vmrouterHelper ($instanceKey,$query);

if (self::$limit===null){
$mainframe = Jfactory::getApplication();
self::$limit= $mainframe->getUserStateFromRequest('com_virtuemart.list.limit', 'limit', VmConfig::get('list_limit', 20), 'int');
}
}
return self::$_instances[$instanceKey];



Versions: Joomla 1.5.25, Virtuemart 2.0.6, 2.0.4, 2.0.3i, PHP 5.3.10-2, SEF on

best regards,
Thomas Kuschel, http://www.loytec.com
Title: Re: Pagination shows only 6 items or the count of former used menu entry
Post by: Milbo on April 17, 2012, 15:56:09 PM
Thank you, this explains me something.

It should even contain the id of the category imho. Then you have the pagination stored per category, that was the idea and I wondered that it did not work with sef. thx.
Title: Re: Pagination shows only 6 items or the count of former used menu entry
Post by: Thomas Kuschel on April 17, 2012, 16:14:42 PM
Hi Milbo,

I've been too early pleased...

I have problems with the posted solution, after some more tests it didn't work any more...

I can't figure out the settings of limit, results, list_limit etc.
Hope you'll find the bug.

In the moment I changed the line 293 to
$vars['limit'] = 0; // vmrouterHelper::$limit;

So I get ALL my products listed! - : ::)



Thomas