Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizventurote/2298848fb6cb23dd1c13cb2990489d5f to your computer and use it in GitHub Desktop.
Save luizventurote/2298848fb6cb23dd1c13cb2990489d5f to your computer and use it in GitHub Desktop.
Programmaticalli create a Yes/No Magento Category Attribute
<?php
/** @var Mage_Eav_Model_Entity_Setup $installer */
$installer = $this;
$installer->startSetup();
$this->addAttribute(
'catalog_category',
'my_custom_attribute',
array(
'group' => 'General Information',
'input' => 'select',
'type' => 'int',
'source' => 'eav/entity_attribute_source_boolean',
'label' => 'My Custom Attribute',
'required' => 0,
'unique' => 0,
'sort_order' => 3,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment