I’ve created a custom attribute for categories in Magento to use in one of the new page layouts that I’m making for a new category; but oddly enough, I’m not able to grab it to the frontend. I’ve been trying to find a solution for this since yesterday, to no avail.
I’ve seen multiple threads on different forums, including SO. I’ve tried multiple solutions. For example:
And also the following:
Which I believe does the same thing. The problem is, they both return the following error which I can’t seem to figure out:
Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Category_Flat::loadAllAttributes() in X:\xampp\htdocs\project\app\code\core\Mage\Catalog\Model\Category.php on line 289
Also, trying to var_dump getData() doesn’t return this attribute, even though it (the attribute) does exist in the backend under “Manage Categories”, and even though it can be modified and saved and remain the way it was last saved when you refresh the page. I’ve also tried multiple solutions that suggests using a loop to loop through all categories and grab the attributes; but that didn’t work either.
Printing the following:
As another thread adviced, didn’t return the attribute I’d created, but it returned the default attributes.
I’ve checked multiple sites to ensure that I didn’t miss anything critical during the creation of the attribute, and so far I’ve not found anything that I’ve missed.
When creating the attribute; the following parameters where used:
$this->addAttribute('catalog_category', 'used_by', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Used by',
'backend' => '',
'visible' => true,
'required' => false,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
My questions are:
- How do I grab the custom attribute that I made and use it in the frontend?
- What are the parameters that have to be there for the attribute to function properly in the backend and frontend?
Thanks in advance,