Tag Archives: attribute and attribute set

Adding a new product attribute to magento and changing the default sort by option in magento

The magento screencast on adding a new product attribute is really what would give a clear idea on adding prodcut attribute.

Step 1: Follow the screencast and add new attribute

Step 2: Since you want this attribute to be used for sorting on list view, make sure the option “Used for sorting in product listing” is set to YES.

Step 3: Add the new attribute to the required attribute set.

Step 4: Go to System > configuration > Catalog > Catalog > Frontend

Step 5: Set the “Product listing sort by” option to the new field you added.

Click on the screenshot above for details.

That’s all, save the configuration, clear cache (if enabled) and relaod the list view. You should see the new attribute.

If you are using a custom template /package, chances are that you may have to change the code manually to view the new sort by field in the selection list.
The code is usually located in in catalog/product/list/toolbar.phtml