I am trying to retrieve the text value for the manufacturer attribute. It is a dropdown field. I tried this:
$manufacturerName = $_product->getAttributeText('manufacturer');
$manufacturerId = $_product->getManufacturer();
$manufacturerName
should display "BrandName", but it always displays 1 even if I change the manufacturer. The $manufacturerId
changes when I change the manufacturer.
I don't understand why the manufacturer name is not displayed correctly. Any ideas?
I think you can check on this code:
$manufacturerName = $_product->getAttributeText('manufacturer');
$manufacturerId = $_product->getResource()->getAttribute('manufacturer')->setStoreId(0)->getFrontend()->getValue($_product);
https://magento.stackexchange.com/questions/62220/getattributetext-use-default-value-regardless-what-store-view-the-user-is-on
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With