Get custom attribute label in Magento


Get custom attribute label in Magento : You can get custom attribute label in magento by loading the product by product id and using the syntax – $product->getResource()->getAttribute(‘my_attribute’)->getStoreLabel(); Here we are going to explain this with simple example and demo.


Get custom attribute label in Magento

You can get the custom attribute in magento simply using the catalog/product model and its resource. Here is simple example how to get custom attribute label in magento –

Get custom attribute label in Magento

$product=Mage::getModel('catalog/product')->load($productId);
$attrLabel = $product->getResource()->getAttribute('my_attribute')->getStoreLabel();

Advertisements

Add Comment

📖 Read More