Get product attribute 'option label'?
This code works fine and avoid to load the entire product obj
$option_id = Mage::getResourceModel('catalog/product')
->getAttributeRawValue($prod_id, $attribure_code, $store_id);
Method 1
$option_value = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setStoreFilter($store_id)
->setIdFilter($option_id)
->getFirstItem()
->getValue();
Method 2 (@Marius)
// to be tested
// not loading the product - just creating a simple instance
$singleton_prod = Mage::getSingleton('catalog/product')
->setStoreId($store_id)
->setData($attribure_code, $option_id);
$optionLabel = $singleton_prod->getAttributeText($attribure_code);
You can also use some thing like this if you have $product
variable.
$product->getResource()->getAttribute($attribute_code)->getFrontend()->getLabel($product);
I used this code.
$some_attr_code = "brand"
$optionId = Mage::app()->getRequest()->getParam('option_id');
/** @var Mage_Eav_Model_Attribute $attribute */
$attribute = Mage::getSingleton('eav/config')->getAttribute(Mage_Catalog_Model_Product::ENTITY, $some_attr_code);
$label = $attribute->getStoreLabel();
if($optionId){
$optionLabel = $attribute->getFrontend()->getOption($optionId);
}