require_once
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array
'group' => 'General',
'
'
'
'
'
'required' => false,
'visible_on_front' => true,
'
);
$installer->addAttribute('catalog_category', 'brand_value', $attribute);
$installer->endSetup();
paste this code in header.phml file and check category menu.
if you want to create custom selectbox for Yes/no attribute use this code
it can use for how to create selectattributes using code. this code use for create select.
require_once
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array
'group' => 'General',
'input' => 'select',
'type' => 'int',
'label' => 'Is Mega Menu',
'source' => 'eav/entity_attribute_source_boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => 1,
'required' => 0,
'visible_on_front' => 0,
'is_html_allowed_on_front' => 0,
'is_configurable' => 0,
'searchable' => 0,
'filterable' => 0,
'comparable' => 0,
'unique' => false,
'user_defined' => false,
'default' => '0',
'is_user_defined' => false,
'used_in_product_listing' => true
);
$installer->
$installer->
0 komentar:
Post a Comment