Get Attribute label easily on Magento

Posted on Updated on

 private static function getAttributeLabel($attributeCode)
{
$query = “SELECT frontend_label FROM eav_attribute WHERE attribute_code = ‘”.$attributeCode.”‘;”;
$data = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’)->fetchOne($query);
return $data;
}

Advertisements