Toggle Nav
My Cart 0

Magento 2 get product dropdown attribute value

Magento 2 get product dropdown attribute value

Use below code to get label of dropdown attribute of any product.

$attribute_code = 'brand';
$brand = $_product->getResource()->getAttribute($attribute_code)->getFrontend()->getValue($_product);			
if ($brand != ''){
       echo $brand;
}
January 8, 2018
Did you like this post?
0
0