rss
twitter
    Find out what I'm doing, Follow Me :)

Thursday, March 11, 2010

Pin It

Widgets

Changing default category sort order in Magento


Category toolbar has many options. By default is shows how many items are in the category, you can choose how many products you wish to be displayed per page, you can change the listing type (List or Grid) and you may choose Sort Order. This “Sort Order” can be confusing. The default “Sort Order” is “Best Value”. What does it mean? How is the Best value determined? Can we change the default sort order? 

What is “Best Value” filed?
When you go to Category page in Magento administration, you will see “Category Products” tab. From there, you will see the list of products that are associated to this category. The last column in “Position”. That is how “Best Value” is determined. So, best value is not something that is dynamically calculated. You can tailor it to your likings.
Magento Category Product List Position

How to change default Sort Order
The file you need to look at is: /app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php Since we’ll modify it, make a copy to /app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php
One there, you will notice this code at the beginning of the file:

1.$this->_availableOrder = array(
2.'position'  => $this->__('Best Value'),
3.'name'      => $this->__('Name'),
4.'price'     => $this->__('Price')
5.);

Default order takes the first value available. So, all you have to do is to either:
  • 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
I hope this will help somebody.

No comments:

Post a Comment