Please see Daniel Kocherga's answer as it will work for you in most cases.
In addition to this method, to get the value of an attribute, you can sometimes get a select or multiselect . In this case, I created this method, which I store in a helper class:
public function getAttributeRawLabel($entityId, $attribute, $store=null) { if (!$store) { $store = Mage::app()->getStore(); } $value = (string)Mage::getResourceModel('catalog/product')->getAttributeRawValue($entityId, $attribute, $store); if (!empty($value)) { return Mage::getModel('catalog/product')->getResource()->getAttribute($attribute)->getSource()->getOptionText($value); } return null; }
Tyler V. May 29 '15 at 1:32 2015-05-29 01:32
source share