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,
));
// Create input type as " textarea "
$setup->addAttribute('catalog_category', 'author_description', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Author_description',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
// Create input type as " Dropdown list box"
$setup->addAttribute('catalog_category', 'vendors', array(
'group' => 'General',
'input' => 'select',
'type' => 'varchar',
'label' => 'Vendors',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'option' => array ('value' => array('optionone' => array('Sony'),'optiontwo' => array('Samsung'),
'optionthree' => array('Apple'),)),
));
?>
// Removing Attribute
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('customer', 'customcode');
?>
Once the attribute is created in the admin panel, remove the above script from the PHTML.its safer
<?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,
));
// Create input type as " textarea "
$setup->addAttribute('catalog_category', 'author_description', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'label' => 'Author_description',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
// Create input type as " Dropdown list box"
$setup->addAttribute('catalog_category', 'vendors', array(
'group' => 'General',
'input' => 'select',
'type' => 'varchar',
'label' => 'Vendors',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'option' => array ('value' => array('optionone' => array('Sony'),'optiontwo' => array('Samsung'),
'optionthree' => array('Apple'),)),
));
?>
// Removing Attribute
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('customer', 'customcode');
?>
Once the attribute is created in the admin panel, remove the above script from the PHTML.its safer
Thanks for sharing.Wea are also a Magento Theme designing company.We are also dealing with other CMS packages like Joomla and Drupal. Hire Magento Developer
ReplyDeletehello! can you post how to set for example optionone as default value? it would be great! thanks
ReplyDeleteNice blog post. Truly inspiring and I also like the language used. Just felt like it transported me to another world. Keep it up. Thanks for a new update.web design orlando
ReplyDeleteThanks for sharing.Wea are also a Magento Theme designing company.We are also dealing with other CMS packages like Joomla and Drupal. website design dubai
ReplyDeleteNice blog! I liked your narrative style of writing which makes the content come alive in more ways than one. Exemplary style. Keep it up.website design dubai
ReplyDeleteI like the article on the topic due to this reason it is seen that other readers are showing their interest by commenting on itfor more knowledge- I was in search of such blog who explore my knowledge in the industry.for more knowledge- link seo in philippines
ReplyDeleteThanks for sharing.Wea are also a Magento Theme designing company.We are also dealing with other CMS packages like Joomla and Drupal. Engineering colleges in vadodara
ReplyDeleteSuperb, what a weblog it is! This blog gives helpful information to us, keep it up.send sms from pc
ReplyDeletevery good information, Mereka memiliki tiga anak dan mengadopsi seorang putri. Pada ketika Perang togel totojitu online Dunia dimulai Townsend mendaftar sebagai perwira militer di ketentaraan. Dia kembali ke South Dakota setelah perang tetapi togel totojitu online kesehatannya tidak lebih baik karena musim dingin yang keras yang memaksanya untuk pindah ke California selatan 8togel. Dia menemukan dirinya dalam praktik medis bersaing dengan dokter yang lebih tua dan dokter modern yang lebih muda dan dia tidak king4d online melakukannya dengan baik secara finansial. Penampilan Great Depression menghapus tabungannya yang tersisa togel lotus4d. Dia bisa mendapatkan janji sebagai petugas kesehatan di Long Beach di mana dia mengamati togel singapore efek Depresi terutama untuk orang Amerika yang lebih tua. Ketika perubahan dalam politik lokal menyebabkan hilangnya pekerjaan togel king4d online ia mendapati dirinya patah lagi. Era kemajuan telah menyaksikan beberapa langkah untuk menetapkan pensiun untuk lxtoto online lansia dan asuransi kesehatan nasional tetapi dengan krisis banyak reformis fokus pada asuransi pengangguran Eyang Togel. Pada akhir 1960an Townsend memutuskan untuk melakukan sesuatu tentang kehancuran Toto Singapore finansial orang tua miskin.
ReplyDelete