0

How to change the products sort order from "desc" to "asc" for one particular category?

Is it possible with layout xml?

2 Answers 2

2

May be something will work for you, just put this code in your category layout update area.

<reference name="product_list"> 
   <action method="setDefaultDirection">
            <string>desc</string>
   </action>
</reference>
1

To change order for particular category you can do something like,

  1. Overwrite the toolbar block form \app\code\core\Mage\Catalog\Block\Product\List\Toolbar.php

  2. Check for the function "getCurrentDirection()"

  3. Under this function you can put your condition with particular categoryID, if you fond that particular category set $dir to "desc" and return $dir

that all.

There might be some other way to do this. For time I found this one. This will 100% work for you.

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.