Wednesday 10 January 2018

How to get dropdown product attribute value in Magento 2

Get Dropdown Product Attribute Value in Magento 2
<?php
$attribute_code = 'availability';
echo $_product->getResource()->getAttribute($attribute_code)->getFrontend()->getValue($_product);
?>

No comments:

Post a Comment