I've created a custom attribute for catalog categories through a installer script. I am pretty sure I had the script ran correctly. Here's my installer script:
$installer = $this;
$entityTypeId = $installer->getEntityTypeId('catalog_category');
$installer->addAttribute('catalog_category', 'special_description', array(
'type' => 'text',
'label' => 'Special Description',
'input' => 'text',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '',
'group' => 'General'
));
I can see the attribute in the Magento Category admin. I can set a value to my attribute and save it.
However, for some reason, I can never get the value in code. This is what I did to get the value of my attribute:
$categoryAttr = Mage::getModel('catalog/category')->load(57)->getData('special_description');
This keeps returning null. I've flushed my cache and reindex the database. But none of these have worked. I can see the value stored in the EAV tables in my database. The attribute is also created in the database. I've spent hours on this but can never understand what's wrong.
How should I get the data of my custom attribute?