How to get the frontend value for the dropdown attribute for the product ?

How to get the frontend value for the dropdown attribute for the product ?

$manufacturerName = $_product->getAttributeText('attribute_code');

$manufacturerId = $_product->getResource()->getAttribute('attribute_code')->setStoreId(0)->getFrontend()->getValue($_product);

Note : Here $_prodct is a variable containing product details.



Copyright © 2024 Tridhya Tech Limited, Inc. All rights reserved.