3

disableParamsMemorizing is working fine with the category pages. But when someone uses the toolbar within the searchresults pages the params are cached.

I have seen i need to put Mage_Catalog_Block_Product_List_Toolbar::disableParamsMemorizing somewhere but i cannot find it. I have placed <action method="disableParamsMemorizing" /> in my templates product toolbar. Why o why is this not working on search pages?

edit: local.xml:

<!-- Quick search -->
<catalogsearch_result_index>
<reference name="search_result_list">
        <action method="setDefaultDirection"><param>desc</param></action>
        <action method="setSortBy"><param>news_from_date</param></action>
    </reference>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        <action method="setDefaultDirection"><param>desc</param></action>
        <action method="setSortBy"><param>news_from_date</param></action>
    </reference>

    <reference name="left">
        <!-- Keep layered navigation always on top. Replace: after="currency" with: before="-" -->
        <!--<action method="unsetChild"><name>catalogsearch.leftnav</name></action>
        <block type="catalogsearch/layer" name="catalogsearch.leftnav" before="-" template="catalog/layer/view.phtml"/>-->

        <!-- Remove currency switcher from sidebar -->
        <action method="unsetChild"><name>currency</name></action>
    </reference>

</catalogsearch_result_index>

i have nothing in my xml for the toolbar.

  • Provide some XML from your layout file. Also take a look at this: magento.stackexchange.com/a/7364/146 – Marius Jan 13 '14 at 14:27
  • edit done, i also read the post. I have put that code in my template/catalog/product/list/toolbar.phtml and that is working great for category pages. The code also shows-up in/around the toolbar on the searchresult pages when i "inspect" the code, but it is still saving the sorting. – Maarten Jan 13 '14 at 14:36
3

Try adding this inside the <catalogsearch_result_index> tag

<reference name="product_list_toolbar">
   <action method="disableParamsMemorizing" />
</reference>
  • You are king! Big thanks, this is working perfect. – Maarten Jan 13 '14 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.