Magento Adding New Category Attribute Without Creating Module

For adding extra attribute to category you need to add below script to your magento root folder and execute it from the URL i.e. http://yoururl/add_category_attribute.php

[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;

// change details below:
$attribute = array(
‘type’ => ‘varchar’,
‘label’=> ‘Your attribute label’,
‘input’ => ‘text’,
‘global’ => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
‘visible’ => true,
‘required’ => false,
‘user_defined’ => true,
‘default’ => “”,
‘group’ => “General Information”
);

$installer->addAttribute(‘catalog_category’, ‘your_attribute_code’, $attribute);

$installer->endSetup();
[/php]

Leave a Comment

Your email address will not be published. Required fields are marked *

*