Creating a New Attribute Set Programatically

Posted . Visible to the public.
$entityTypeId = Mage::getModel('catalog/product')
                  ->getResource()
                  ->getEntityType()
                  ->getId();

$attributeSet = Mage::getModel('eav/entity_attribute_set')
                  ->setEntityTypeId($entityTypeId)
                  ->setAttributeSetName('test_set');

$attributeSet->validate();
$attributeSet->save();

$attributeSet->initFromSkeleton($skeletonID)->save();

You need to save before you do initFromSekeleton().

Mike Whitby
Posted by Mike Whitby to Magento (2014-02-04 14:25)