Magento World

As a Magento parner, we are very honoured to offer you the best Magento Extensions, Magento Modules, Magento Themes and Magento Templates. You will get full support until you feel satisfied! View our Magento page to find what you need!

Thứ Hai, 26 tháng 3, 2012

Get Magento Product Attribute Label

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.

Adam Moss Author Page


View the original article here

Không có nhận xét nào:

Đăng nhận xét