Code for sorting by default for ascending order or descending order in Magento 1 - Magesan

Code for sorting by default for ascending order or descending order in Magento 1

Code for sorting by default for ascending order or descending order in Magento 1

Go to your themse’s local.xml and place the code

<catalog_category_default>
          <reference name="product_list">
            <action method="setDefaultDirection"><dir>desc</dir></action>
          </reference>
        </catalog_category_default>

        <catalog_category_layered>
          <reference name="product_list">
            <action method="setDefaultDirection"><dir>desc</dir></action>
          </reference>
</catalog_category_layered>

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>