Get attribute lable by attribute code and attribute ID in magento

Get attribute lable by attribute code and attribute ID in magento

Below code will helpful to find the attribute Lable by attribute Id and code

Example:
1. 65 is  attribute value
2. color is an attribute code

$_product = Mage::getModel(‘catalog/product’);
$attr = $_product->getResource()->getAttribute(“color”);
if ($attr->usesSource()) {
echo $color_label = $attr->getSource()->getOptionText(“65”);
}

 

————————————————————————————————————————————————————————————-

Corner of Blog:

”¬†Save Electricity Power !!! “

———————————————————————————————————————————————————————————————-