Skip to content

Instantly share code, notes, and snippets.

@riterrani
Created October 10, 2014 15:26
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 riterrani/d9cabb85e967a02c995c to your computer and use it in GitHub Desktop.
Save riterrani/d9cabb85e967a02c995c to your computer and use it in GitHub Desktop.
<?php
$installer = $this;
$installer->startSetup();
$entityTypeId = $installer->getEntityTypeId('catalog_category');
$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute('catalog_category', 'new_cat_attrb', array(
'type' => 'int',
'label' => 'New Category Attribute',
'input' => 'text',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0
));
$installer->addAttribute('catalog_category', 'new_cat_attrb', array(
'type' => 'int',
'label' => 'New Category Attribute',
'input' => 'text',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0
));
$installer->addAttributeToGroup($entityTypeId,$attributeSetId,$attributeGroupId,'new_cat_attrb','11');
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment