Posted in:
Magento 2 Tutorials
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?