Home > Magento Tips > Get Magento Product Attribute Label

Get Magento Product Attribute Label

Posted on: 20th Jan 2012 By: Adam Moss 2 Comments

Half way through writing a customised grouped product page for Magento, I realised that I’d never come across getting attribute labels before. I already had the attribute code loaded, so I just needed the script to load it by that attribute code. It turns out that product attribute labels is a bit of a tumbleweed subject in the online community so I dug it out of Mage/Eav/Model:

$product->getResource()->getAttribute('my_attribute_code')->getStoreLabel(); 

It makes echoing out product attributes a much more dynamic affair. Thanks for reading the Magento Blog at Ecommerce Web Design.

2 Responses to “ Get Magento Product Attribute Label ”

  1. Joe Anderson
    #1 | 25th January 2012

    Thanks for posting, i’ve been looking a while after that answer!

  2. Alex
    #2 | 30th January 2012

    Whoa! i found what i was looking for. Thanks for posting :)

Post A Comment

Your comments:
Enclose code snippets within the appropriate tags: [php][/php]   [js][/js]   [xml][/xml]   [css][/css]   [html][/html]
E.g: [php]<?php echo "hello world"; ?>[/php]

Search Blog

Archives

For the record...

Views & opinions in this blog are those of the individual and do not necessarily reflect those of E-commerce Web Design or the Creare Group.