To support our customers during COVID-19 pandemic, we had introduced many
offers and discounts
to help your ecommerce businesses. Learn more

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