I have an existing attribute for an embed code. I need to associate this attribute with 120+ existing attribute sets.
If I know the attribute set id, ho
The function Mage_Catalog_Model_Resource_Setup::addAttribute() can be used to update as well as add attributes. Another thing I find useful is if you specify a group with this function it is automatically assigned to all sets.
$attributeCode = 'name'; // choose your attribute here
$setup = Mage::getResourceSingleton('catalog/setup');
$setup->addAttribute('catalog_product', $attributeCode, array(
// no need to specify fields already used like 'label' or 'type'
'group' => 'General',
'sort_order' => 10
));