Magento – get Attribute Options of the dropdown type attribute
For the attributes which have a frontend type “Select” we need to define options that on the product page converted into a dropdown. For example attribute color may have options Red, Green, Blue etc. which are defined in the admin area.
We can easily collect all the defined options for any attribute.
This code will return all options of attribute “color”
// use your own attribute code here $attribute_code = "color"; $attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code); $options = $attribute_details->getSource()->getAllOptions(false); Foreach($options as $option){ // print_r($option) and find all the elements echo $option["value"]; echo $option["label"]; }