Skip to content

Instantly share code, notes, and snippets.

@martisj
Last active August 29, 2015 14:01
Show Gist options
  • Save martisj/c1f6cbc5bc112480c8d9 to your computer and use it in GitHub Desktop.
Save martisj/c1f6cbc5bc112480c8d9 to your computer and use it in GitHub Desktop.
Add Attribute to attributeset default and group general
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
// Add attributes to the various sets
$attributeId = $setup->getAttribute('catalog_product', 'teaser');
$attributeSetId = $setup->getAttributeSetId('catalog_product', 'Default');
//Get attribute group info
$attributeGroupId = $setup->getAttributeGroup('catalog_product', $attributeSetId, 'General');
//add attribute to a set
$setup->addAttributeToSet('catalog_product', $attributeSetId, $attributeGroupId, $attributeId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment