How to change magento search results in alphabetical order

By

January 11, 2016MagentoNo comments

Magento Quick Search functionality by default orders the results based on relevance. Sometimes we may need the search results to be ordered alphabatically or any custom order based on product attribute. We can achieve this by adding a simple code snippet in our themes layout file. In Order to Sort the search results by product name, the name attribute should be configured properly in Magento Admin Panel. Navigate to Catalog -> Manage Attributes and search by the attribute code. For Product name the attribute code is name. AttributeName The Attribute configuration must be changed to use in the Product Listing and Sorting. AttributeSettings Finally in your current theme create a file name local.xml to override the default behaviour and add the below code snippet.

Compatability :- Magento 1.8,1.9

Leave a Reply