iFUEL INTERACTIVE

A NY Interactive Agency and a Division of Agency212

See you on Flickr See you on Twitter See you on FaceBook Subscribe

Posts Tagged ‘Code’

Getting the Text Value of a Category Attribute of Type Select
December 30th, 2011  |  NO COMMENTS  |  Magento Moments
Tags: , , , , ,

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());

Categories
Archives
Tags
From Our Twitter (@ifuel)
Our Interactive Agency on Facebook
Copyright iFuel Interactive © 2010. All Rights Reserved.
Going up? Click here.A NY INTERACTIVE AGENCY