iFuel Announces Launch of A2C Platform for Ecommerce Alcohol Sales. Read More

Getting the Text Value of a Category Attribute of Type Select

As shown elsewhere, you can add an attribute to the category entity in Magento.  If the attribute is of type select, getting the text value of an option is a bit of a pain:

$category = Mage::getModel(‘catalog/category’)->load(10);

$attribute = Mage::getSingleton(‘eav/config’)->getAttribute(‘catalog_category’, ‘myattribute_code’);

$text = $attribute->getSource()->getOptionText($category->getMyattributeCode());

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>