Skip to main content

On product pageProduct Detail Page or list pageon 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 '<br>';
    echo $attrColor->getLabel(); 
    }           
 ?>

On product page or 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(); 
    }           
 ?>

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(); 
}           
?>
added 27 characters in body
Source Link
Arunendra
  • 7.5k
  • 3
  • 29
  • 55

On product page or 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(); 
    }           
 ?>

On product page or list page you can get attribute 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(); 
    }           
 ?>

On product page or 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(); 
    }           
 ?>
Source Link
Arunendra
  • 7.5k
  • 3
  • 29
  • 55

On product page or list page you can get attribute 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(); 
    }           
 ?>