Get attribute admin option value if you have option Id or store view value
For getting option value for admin
then you can get by below code and Where 0 is admin store id
$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','color');
$collection =Mage::getResourceModel('eav/entity_attribute_option_collection')
->setPositionOrder('asc')
->setAttributeFilter($attributeId)
->setStoreFilter(0)
->load();
echo "<pre>";
print_r($collection->toOptionArray());
echo "</pre>";
You need to just change store
view ids on place of 0;
Here my full solution for a certain problem. Perhaps someone can use it.
function getImgColor($productId, $colorOfProduct)
{
$optionId = Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'color', 1);
$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','color');
$collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setPositionOrder('asc')
->setAttributeFilter($attributeId)
->setStoreFilter(0)
->load();
$collection = $collection->toOptionArray();
foreach ($collection as $option) {
if ($option['value'] == $optionId) {
$img = $option["label"];
break;
}
}
return file_exists(Mage::getBaseDir('media')."/colorall/_thumbs/color/".$img.".png") ? "<img src=\"".Mage::getBaseUrl('media')."colorall/_thumbs/color/".$img.".png\" title=\"".$colorOfProduct."\" />" : Mage::getBaseDir('media')."/colorall/_thumbs/color/".$img.".png";
}