Create one php file into your App folder, write the below code in that file and run this file.
Then go to Catalog -> Manage Catagory and see there your custom fields.
<?php
// initialize magento environment for 'default' store
require_once 'app/Mage.php';
Mage::app('default');
echo "initialising<br>";
echo runAdd();
echo "finishing";
function runAdd()
{
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
// below code will add text attribute
$setup->addAttribute('catalog_category', 'category_logo', array(
'group' => 'General',
'type' => 'varchar',
'input' => 'image',
'backend' => 'catalog/category_attribute_backend_image',
'label' => 'Category Logo',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
}
Then go to Catalog -> Manage Catagory and see there your custom fields.
<?php
// initialize magento environment for 'default' store
require_once 'app/Mage.php';
Mage::app('default');
echo "initialising<br>";
echo runAdd();
echo "finishing";
function runAdd()
{
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
// below code will add text attribute
$setup->addAttribute('catalog_category', 'category_logo', array(
'group' => 'General',
'type' => 'varchar',
'input' => 'image',
'backend' => 'catalog/category_attribute_backend_image',
'label' => 'Category Logo',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
}
No comments:
Post a Comment
Thanks for your comments.