I what to display only 3 products per page. So in my catalog.xml I have
<action method="setDefaultGridPerPage"><limit>3</limit></action>
<action method="addPagerLimit"><mode>grid</mode><limit>3</limit></action>
If I go to /category.html I will see only 3 products. It works, great!
But also I want to be able to show all products at once, so I add to the catalog.xml the following:
<action method="addPagerLimit"><mode>grid</mode><limit>999</limit></action>
Now, if I navigate to /category.html?limit=999 I can see all the categories products, as expected.
When I come back to /category.html, with no limit params, it displays all the products instead of the 3 I wish it did. It happends because Magento caches the limit preference.
Is there a configuration that prevents magento from caching listing options?
Thank you in advance.
In the toolbar block there is a method called disableParamsMemorizing. This should disable the storing of parameters in session.
Try to add this in the toolbar block.
<action method="disableParamsMemorizing" />
or you can override the Mage_Catalog_Block_Product_List class and make the getToolbarBlock method look like this:
public function getToolbarBlock()
{
if ($blockName = $this->getToolbarBlockName()) {
if ($block = $this->getLayout()->getBlock($blockName)) {
$block->disableParamsMemorizing();
return $block;
}
}
$block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());
$block->disableParamsMemorizing();
return $block;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With