Reputation: 29
I am looking to add a text input box in admin section of Magento in the Magento manage categories page.Is it possible to do that? If yes, I would like to know how.
Upvotes: 0
Views: 1818
Reputation: 1061
We can add attribute using code
other option is you can install below module :
http://www.magentocommerce.com/magento-connect/custom-attributes-4340.html
Upvotes: 2
Reputation: 1293
I think you are trying to add an attribute within Manage Categories section in Magento admin.
To add an attribute you need to run a SQL file using a custom module.
Here is the code snippet which you can execute -
<?php
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->removeAttribute('catalog_category', 'attribute_code');
$installer->addAttribute('catalog_category', 'attribute_code', array(
'group' => 'General Information',
'type' => 'text',
'label' => 'Attribute Label',
'input' => 'text',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'visible_on_front' => true,
'is_html_allowed_on_front' => true,
'position' => 4,
'sort_order' => 4,
));
$installer->endSetup();
?>
I hope you're looking for the above code.
Upvotes: 0
Reputation: 143
You can do it by creating text box in the adminhtml template file. Most probably this would be:
magento/app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml
But you also need to create new column in database to save the data. You can do that by writing a simple extension of your own and with a SQL upgrade script.
Upvotes: 0