I added below code
<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$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();
?>
in my header.phtml
for create custom attribute in category portion. I know it's not a best practice while adding db code in .phtml.
can you please anyone tell me where i have to add?