Avenir | Drupal Development | Joomla Development | Magento Development | OsCommerce Development
Showing posts with label add attribute. Show all posts
Showing posts with label add attribute. Show all posts

Tuesday, 21 February 2012

Add new attribute into product catagory in magento and removing the same attribute

In any one of the .PHTML page paste the following code( i.e, app\design\frontend\base\default\template\page )
<?php

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

// Create input type as "Textbox"

$setup->addAttribute('catalog_category', 'author', array(
    'group'         => 'General',
    'input'         => 'text',
    'type'          => 'varchar',
    'label'         => 'Author',
    'backend'       => '',
    'visible'       => 1,
    'required'      => 0,
    'user_defined' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));