i am using magento enterprise edition, i have created a module to add custom attributes to the categories , the attributes are visible in adminhtml and they are saved propertly but when i try to retrieve the category on frontend, it doesnot contain the attributes i just created and i alredy reindex all but nothing, the problem is magento enterprise because i tried in magento community and works fine, here is my code

   $installer = Mage::getResourceModel('catalog/setup','catalog_setup');

 $installer->addAttribute('catalog_category', $label, array(
                   'type' => 'int',
                   'label' => $label,
                   'input' => 'select',
                   'source'  => 'eav/entity_attribute_source_boolean',
                   'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
                   'visible' => true,
                   'required' => false,
                   'default' => '0',
                   "visible_on_front"  => true,
                   'group' => 'filter9',

here is the config file

 <?xml version="1.0"?>

                             <Qxd_Categories before="Mage_Adminhtml">Qxd_Categories_Adminhtml</Qxd_Categories>



And this is front end where i am trying to reindex data and retrieve the category:

 $categories = Mage::getModel('catalog/category')->getCollection()
 $process = Mage::getModel('index/process')->load(5);   $process->reindexAll();
  $process = Mage::getModel('index/process')->load(6);    $process->reindexAll();
 foreach ($categories as $category) {

$cat = Mage::getModel("catalog/category")->load($category->getId());
        var_dump($cat->getData()); // all but my attribute
        var_dump($cat); // my attribute is not there :(

        var_dump($cat->getName()); // My  Category Name


Any suggestion is welcome, please help me!!


Your attribute code is whatever when you can this field by $cat->getWhatever(); If this attribute is what_ever the _ (underscore make next letter of capital) thus

  • 1
    ignore that line, when i did var_dump($cat->getData()), my attribute is not there. or when i do var_dump($cat) my attribute is not there :(
    – MaynorSong
    Jun 26 '14 at 14:24

You can get all your categories for a specific store using a helper:

$helper = Mage::helper('catalog/category');
$categories = $helper->getStoreCategories();

Then you can add your attribute to this collection by adding the following to your modules config.xml.

  • the problem is that the attributes must be created dynamically and in adminhtml the user decides the value so i cant use xml for this =S
    – MaynorSong
    Jun 26 '14 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.