B-219 Sec-55 Noida, India
+918010221733

How to change Default Sort Order Magento

I’ll be clear… Magento is not good as you could imagine. In fact sucks in so many ways.

Today i’m showing you one. There is no backend option to change the Default Sort Order in your product listing (catalog).

Lucky there is an easy solution.
The Toolbar

Look for the file toolbar.php located in:

/app/code/core/Mage/Catalog/Block/Product/List
Create the Local folder

Create the same folder structure in the local. Now the future upgrades will not affect your changes.

Should be like:

/app/code/local/Mage/Catalog/Block/Product/List
Edit the Toolbar

Now you have to change 1 single stupid line.

Look for:
  /**
     * Default direction
     *
     * @var string
     */
    protected $_direction           = ‘asc’;

And change it for:
  /**
     * Default direction
     *
     * @var string
     */
    protected $_direction           = ‘desc’;

(Visited 64 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.