2
เพิ่มแอตทริบิวต์ที่กำหนดเองให้กับชุดแอตทริบิวต์ที่กำหนดเองโดยทางโปรแกรม
สวัสดีมีคนช่วยฉันได้ไหม ฉันสร้างชุดแอตทริบิวต์ที่กำหนดเองและแอตทริบิวต์ที่กำหนดเองเป็น $installer = $this; /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer->startSetup(); //Create Attribute set with Based on Default attribute set //$installer->removeAttributeSet(Mage_Catalog_Model_Product::ENTITY, 'New Attr Set'); /* $skeletonID=$installer->getAttributeSetId('catalog_product','Default'); $entityTypeId = Mage::getModel('catalog/product') ->getResource() ->getEntityType() ->getId(); //product entity type $attributeSet = Mage::getModel('eav/entity_attribute_set') ->setEntityTypeId($entityTypeId) ->setAttributeSetName("New Attr Set"); $attributeSet->validate(); $attributeSet->save(); $attributeSet->initFromSkeleton($skeletonID)->save(); //Create attribute new_attr //$installer->removeAttribute('catalog_product', 'new_attr'); …