I have created one drop down attribute, I followed this tutorial to get selected values from that attribute. I successfully get the result, But I want to render whole drop down.What I do for achieve this?
1 Answer
On Product Detail Page or on Product List Page you can get attribute (color replace with yours) drop down value using following code:
<?php
$attr = $_product->getResource()->getAttribute('color')->getOptions();
foreach ($attr as $attrColor) {
echo $attrColor->getValue();
echo '<br>';
echo $attrColor->getLabel();
}
?>