Jul/09
14
How to change default Sort Order
1 Comment · Posted by leo in cms, design, development, magento
The file you need to look at is: /app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php. Please do a backup for this file first.
On there, you will notice these codes at the beginning of the file:
1 2 3 4 5 | $this->_availableOrder = array(
'position' => $this->__('Best Value'),
'name' => $this->__('Name'),
'price' => $this->__('Price')
); |
Default order takes the first value available(The first one is the system automatic load one).
So, all you need to do is:
•reorder it if you want to have a selection in the Toolbar or
•set only one value of choice if you will remove the selection from the toolbar
For example, if you want sort by SKU, just simply update it to:
1 2 3 4 5 | $this->_availableOrder = array(
'position' => $this->__('SKU'),
'name' => $this->__('Name'),
'price' => $this->__('Price')
); |
Hope this can help someone.
development · magento · sort order

rahul chaudhari · 05/08/2010 at 12:11
this code is not available in magento 1.4.1.0