Created
April 16, 2016 18:24
-
-
Save aurire/c81d212bd5e243d7211c4df309ccf710 to your computer and use it in GitHub Desktop.
Magento. Delete attribute set by attribute set name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$entityTypeId = Mage::getModel('eav/entity') | |
->setType('catalog_product') | |
->getTypeId(); | |
$attributeSetName = 'My New Set'; | |
$attributeSetId = Mage::getModel('eav/entity_attribute_set') | |
->getCollection() | |
->setEntityTypeFilter($entityTypeId) | |
->addFieldToFilter('attribute_set_name', $attributeSetName) | |
->getFirstItem() | |
->getAttributeSetId(); | |
Mage::getModel("eav/entity_attribute_set")->load($attributeSetId)->delete(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment