Reputation: 1
I'm currently using magento 1.9. I'm looking to sort the product list by alphabet and manufacturer/supplier.
Is it possible to apply your own sort order and also is it possible to have two criteria on sorting. Just like in SQL, order by name,manufacturer ?
If you can please help me locate the files to edit, that would be greatly appreciated. I'm new to magento development.
Thanks.
Upvotes: 0
Views: 2002
Reputation: 542
You can add simple sorting options like name and manufacturer via the Magento admin with no development work. The following steps would add both 'name' and 'manufacturer' in the 'sort by' drop down on the catalog view.
For the attributes 'name' and 'manufacturer' go to CATALOG > ATTRIBUTES > MANAGE ATTRIBUTES in your Magento admin. You can find these attributes by their attribute codes, simply 'name' and 'manufacturer'. Click on each to edit their settings -> at the bottom of each page is a dropdown labelled 'Used for Sorting in Product Listing'. If set to yes, these values will be added the sort by dropdown options.
As an aside you can add your own custom attributes using this section of the admin and set those to be included as sortable attributes too.
The same can be achieved programatically, allowing you to implement something more complex... I've found this article useful in the past http://www.atwix.com/magento/custom-sorting-product-listing/ - simply swap the date created helper for an existing or customer helper, and this will be added to the array which builds the sort by options.
Upvotes: 1