I've created a custom extension in order to add a custom attribute on product Categories.
Here's the code I've used to create it:
$installer = $this;
$installer->startSetup();
$attribute = array(
'type' => 'int',
'label'=> 'Featured Author',
'input' => 'checkbox',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0,
'source' => "eav/entity_attribute_source_boolean",
'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'featured_author', $attribute);
$installer->endSetup();
The attribute is created and it's visible on backend. I also checked eav_attribute database table and the attribute is created in there too.
But changing the attribute's value (check/uncheck) and then saving category has no effect at all. The attribute value is not updated/saved. The checkbox is always unchecked.
What should I do to fix this?
Best Answer
Use the field yes/no instead of checkbox