/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/ file mysql4-install-0.1.0.php <?php $installer = $this; $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer->startSetup(); /** * Adding Different Attributes */ // adding attribute group //Mage_Eav_Model_Entity_Setup addAttributeGroup (mixed $entityTypeId, mixed $setId, string $name, [int $sortOrder = null]) $setup->addAttributeGroup('catalog_product', 'Default', 'Special Attributes', 1000); // the attribute added will be displayed under the group/tab Special Attributes in product edit page 'group' => 'Special Attributes', 'input' => 'text', 'type' => 'text', 'label' => 'Testing', 'backend' => '', 'visible' => 1, 'required' => 0, 'user_defined' => 1, 'searchable' => 1, 'filterable' => 0, 'comparable' => 1, 'visible_on_front' => 1, 'visible_in_advanced_search' => 0, 'is_html_allowed_on_front' => 0, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, )); $installer->endSetup();
URL: http://blog.chapagain.com.np/magento-adding-attribute-from-mysql-setup-file/