0

I am trying to update the default sort options for list pages. Here's what I have in catalog.xml

    <reference name="product_list">
        <action method="setAvailableOrders" json="value">
            <value><![CDATA[{"news_from_date":"New Arrivals","price":"Price"}]]></value>
        </action>
    </reference>
    <reference name="product_list_toolbar">
        <action method="setDefaultDirection"><dir>desc</dir></action>
        <action method="setDefaultOrder"><string>news_from_date</string></action>
    </reference>
</catalog_category_layered>

When I load a category page, the products are sorted ascending but the toolbar is indicating that they're sorted descending. If I click on the ascending icon, it will reload the grid in ascending order. If I then click on the descending icon, the grid will reload with the items in descending order.

1
  • Did you changed catalog/product/list/toolbar.phtml? If so, try to copy it from rwd theme: app/design/frontend/rwd/default/template/catalog/product/list/toolbar.phtml into your theme, and check if it works. If it works - then your toolbar.phtml is not good, you've broke backward compatibility with modifications. Commented Feb 28, 2017 at 20:46

1 Answer 1

0

I found the problem yireo has a GTM module, https://github.com/yireo/Yireo_GoogleTagManager that is setting the sort order to ASC on line 154 https://github.com/yireo/Yireo_GoogleTagManager/blob/master/source/app/code/community/Yireo/GoogleTagManager/Block/Category.php am not sure why they do this but i reported the bug to them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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