Monthly Archives: March 2013

Magento Addding the Image Attribute

Adding the Attribute for Product is quite easy but Adding an Attribute for Categroy  is not easy but also not hard ,Just need to follow the magento Structure instead of Running the Query from PHPmyadmin

We can added either text field or an another image Attribute just open header.phtml Or any of the Phtml File and just add the following code which will help to generate the attribute in admin for category and also add in the Database also

Add the Following code

<?php $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('catalog_category', 'sliderimage4', array(
    'group'         => 'General',
    'input'         => 'image',
    'type'          => 'varchar',
    'label'         => 'Slider Image4',
    'backend'       => 'catalog/category_attribute_backend_image',
    'visible'       => 1,
    'required'        => 0,
    'user_defined' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
?>

Here sliderimage4 is the Attribute ..in this way you can add as many attribute as you can

Note:Once you run the script remove the code from phtml file …Hope this will help you