1

I have a list of products with 3 attributes (Date, among others) to sort by. By default the sorting is an ascending order, is there a way to change it to be a descending order instead?

1 Answer 1

2

You cannot change it simply in the backend, however you can edit the local.xml file and add the following depending on your needs

Location of that file is here normally:

app/design/frontend/{package}/{theme}/layout

<layout>
    <catalog_category_default>
      <reference name="product_list_toolbar">
          <action method="setDefaultDirection"><string>asc</string></action>
      </reference>
    </catalog_category_default>

    <catalog_category_layered>
      <reference name="product_list_toolbar">
        <action method="setDefaultDirection"><string>asc</string></action>
      </reference>
    </catalog_category_layered>

    <catalogsearch_result_index>
      <reference name="search_result_list">
        <action method="setDefaultDirection"><string>asc</string></action>
      </reference>
    </catalogsearch_result_index>
    <catalogsearch_advanced_result>
      <reference name="search_result_list">
        <action method="setDefaultDirection"><string>asc</string></action>
        </reference>
    </catalogsearch_advanced_result>
</layout>
2
  • updated the answer
    – seb
    Commented May 18, 2016 at 10:34
  • Klettseb do you know how to do this in M2.x? I have created an attribute but magento sorts on the first digit instead of the whole integer. E.g. order is 1, 11, 2. While it should be: 1, 2, 11. Commented Oct 30, 2019 at 20:31

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.