1

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?

  • Do you want to show all drop down option list ? – Arunendra Apr 12 '16 at 11:19
  • yes, exactly @Arunendra – Bilal Usean Apr 12 '16 at 11:28
2

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(); 
}           
?>

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.