Tuesday, 26 May 2015

Create custom category attribute in magento

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('catalog_category', 'category_color', array(
'group' => 'General',
'input' => 'select', //type of attribute here
'type' => 'varchar',
'label' => 'Show On Home',
'option' => array ('value' => array('optionone'=>array(0=>'No'),'optiontwo'=>array(0=>'Yes'))),
'backend' => 'eav/entity_attribute_backend_array',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->endSetup();

No comments:

Post a Comment

about new GraphQL freature in Magento2

GraphQL: GraphQL is a data query language developed internally by Facebook in 2012 before being publicly released in 2015. Magento impleme...