Is there a way to "bound" two different attributes to the same attributes options?

I have two attributes with dropdowns, but I want them to share same options. Now every time I want to add a new option or edit existing one I have to do it twice.

Please let me know what is the best way to achieve such thing.


You can do that if you create the second attribute with a custom source model.
Here is an example of creating such an attribute.
In that example you need to change the method getAllOptions and make it read the options of your other attribute.
Let's say your first attribute has the code some_attribute you method needs to look like this:

public function getAllOptions($withEmpty = false){
    return Mage::getModel('eav/config')
             ->getAttribute('catalog_product', 'some_attribute')
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.