Creating attribute sets and attributes programmatically

后端 未结 3 2031
时光取名叫无心
时光取名叫无心 2021-01-16 06:23

I am using the code listed on the following link:

http://www.magentocommerce.com/wiki/5_-_modules_and_development/catalog/programmatically_adding_attributes_and_att

3条回答
  •  感动是毒
    2021-01-16 07:02

    There is an easier one-liner for this. Just extend Mage_Eav_Model_Entity_Setup for your install script and use something like this in your installer:

    $installer = $this;
    /* @var $installer Mage_Eav_Model_Entity_Setup */
    
    $installer->startSetup();
    $installer->addAttributeSet(Mage_Catalog_Model_Product::ENTITY, 'New Attribute Set Name');
    $installer->endSetup();
    

提交回复
热议问题