[Magento] How to add additional sort by : Newest product and make the default sort order direction to DESC for the product listing.

 

1) Goto Catalog->Manage Attributes->Set Product as New from Date attribute

2) Mark it as Yes for sorting in product listing page

The main issue for the new product will not work even though you have set it up as above.

As a default, it will be selected for the newest but the output might be  shown from the oldest.

Change Direction from Ascending to Descending:

To change default product direction from ascending to descending-

go: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php

Now Open the Toolbar.php file and find out the following line (Line no. 119 in 1.5):

  1. protected $_direction = ‘asc’;

Now Change above code by the following code:

  1. protected $_direction = ‘desc’;

After doing this, refresh your category page. If not any change you must clear cache and Reindex by go: System -> index Management from Backend now select all checkbox.

Then Select ‘Reindex Data’ in Actions field after that click on Submit button from right top.

Now your product will show by descending direction as default in Category page.