Magento check existence attribute value

UPDATE 2015-11-09: I forgot one function

Just a few little functions as an example of how I checked for various attribute values in our Magento store. If the value exists the value id is returned and if it doesn’t the value is first inserted and the resulting id is then returned. In this example I will be using the attribute Manufacturer since it will be something people regularly use. Of course the code can be changed to be made to work with any attribute like flavor, color, size etc:

Mind you I found this code on the Magento forums but it was difficult to find, so I copied it here for safe keeping.

Leave a Reply