Add custom attribute for category

Follow bellow steps
Step : 1 app\etc\modules\AR_Dbchange.xml
<?xml version="1.0"?>
<config>
<modules>
<AR_Dbchange>
<active>true</active>
<codePool>local</codePool>
</AR_Dbchange>
</modules>
</config>
Step : 2 app\code\local\AR\Dbchange\etc\config.xml
<?xml version="1.0"?>
<config>
<modules>
<AR_Dbchange>
<version>0.1.0</version>
</AR_Dbchange>
</modules>
<global>
<resources>
<ar_dbchange_setup>
<setup>
<module>AR_Dbchange</module>
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
</setup>
</ar_dbchange_setup>
</resources>
</global>
</config>
Step : 3 app\code\local\AR\Dbchange\sql\ar_dbchange_setup\mysql4-install-0.1.0.php
<?php

$installer
= $this;
$installer
->startSetup();

$attribute
= array(
'group' => 'General',
'input' => 'select',
'type' => 'int',
'label' => 'Mobile (api)',
'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
->addAttribute('catalog_category', 'mobile_api', $attribute);
$installer
->endSetup();

?>
Step : 4 After refresh all magento cache to admin side (System -> Cache Management) and logout ,login again

Comments

Popular posts from this blog

Through Postman Api send data through JSON and create simple product in Magento2

Getting product Image in PHTML in Magento2

programmaticlly Create Order in Magento2 with custom options in order