Prevent Magento from caching query strings, such as limit param -
the behavior
i display 3 products per page. in catalog.xml have
<action method="setdefaultgridperpage"><limit>3</limit></action> <action method="addpagerlimit"><mode>grid</mode><limit>3</limit></action>
if go /category.html see 3 products. works, great!
but want able show products @ once, add catalog.xml following:
<action method="addpagerlimit"><mode>grid</mode><limit>999</limit></action>
now, if navigate /category.html?limit=999 can see categories products, expected.
the problem:
when come /category.html, no limit params, displays products instead of 3 wish did. happends because magento caches limit preference.
the question:
is there configuration prevents magento caching listing options?
thank in advance.
in toolbar block there method called disableparamsmemorizing
. should disable storing of parameters in session.
try add in toolbar block.
<action method="disableparamsmemorizing" />
or can override mage_catalog_block_product_list
class , make gettoolbarblock
method 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; }
Comments
Post a Comment