Magento: change applied attribute product types

Sometimes it is necessary to change the product type(s) an attribute is applied to in Magento. A common example is, that you designed and implemented an attribute for a configurable product, because you thought its real world value is equal over all child manifestations.
But after a while you realize, that there are differences that you have to consider. Let’s say the Magento products attributes attribute1 and attribute2 are currently applied to configurable products only. The following snippet shows, how you can achieve this within a modules setup script in Magento:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.