I using Magento 1.6.2.
Is there any way to set the position for Attribute Option Labels on a Site View Level and not on a global level?
Reason: Here the Values for Color in English and German
Black / Schwarz
Clear / Transparent
Copper / Kupfer
Yellow / Gelb
It is obvious that the sorting is different for different languages.
Overriding the position value and sorting the values in the frontpage code is not possible because there are options where alphanumeric sorting doesn’t make sense:
i.e. Small Medium Large
Please help
Yes, this is very possible. But it’s a fairly deep change, depending on what you would like to accomplish with this. This will get you started:
You want to first add a new column to
eav/attribute_option_valuetable. Here is the setup script for that:Next, you need to rewrite
Mage_Eav_Model_Mysql4_Entity_Attribute_Option_Collection. When performing the join for the store filter, you need to add your sort_order there:To show what is going on: each attribute has a source model. The source model is responsible for providing the values in a frontend dropdown-type list (select, multiselect). If the source model is
Mage_Eav_Model_Entity_Attribute_Source_Table, which it will be by default if the attribute type is select or multiselect, then this code retrieves the values:As you can see, we are rewriting the
setStoreFilter()function. This is the last one called. You might want to add anunshiftOrder('main_table.sort_order', 'ASC')at the beginning of the rewritten function, just for good measure that the `main_table.sort_order does not get in the way.I’ll leave it to you to make the necessary adjustments to the admin panel to provide the option for setting the sort order matrix.