Last active
August 29, 2015 14:13
-
-
Save RabeaWahab/aa5eabc6c64342e2969b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->startSetup(); | |
/** | |
* Use those two commands to delete the attribute for testing | |
*/ | |
//$this->removeAttribute('catalog_category', 'custom_attribute_1'); | |
//$this->removeAttribute('catalog_category', 'custom_attribute_2'); | |
// creating the attributes | |
$this->addAttribute('catalog_category', 'custom_attribute_1', array( | |
'input' => 'multiselect', | |
'type' => 'text', | |
'label' => 'Category Filters', | |
'backend' => 'eav/entity_attribute_backend_array', // this is important so the system can undertsand to convert the options to a string to be saved | |
'visible' => true, | |
'required' => false, | |
'visible_on_front' => true, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
'source' => 'Custom_Module_Model_Options', // you use this for custom option in your own class | |
'position' => 100, | |
'group' => 'Custom Attribute 1', | |
'user_defined' => true, | |
)); | |
$this->addAttribute('catalog_category', 'custom_attribute_2', array( | |
'input' => 'select', | |
'type' => 'int', | |
'label' => 'Category Filters Enabled', | |
'backend' => '', | |
'visible' => true, | |
'required' => false, | |
'visible_on_front' => true, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
'source' => 'eav/entity_attribute_source_boolean', | |
'position' => 99, | |
'group' => 'Custom Attribute 2', | |
'user_defined' => true, | |
)); | |
$this->endSetup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment