Created
July 17, 2012 21:13
-
-
Save cgdangelo/3132147 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
require 'app/Mage.php'; | |
umask(0); | |
Mage::app(); | |
$attribute = Mage::getModel('catalog/entity_attribute')->loadByCode( | |
Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId(), | |
'tiger_cost' | |
); | |
$attributeSets = Mage::getModel('eav/entity_attribute_set')->getCollection(); | |
foreach ($attributeSets as $set) { | |
$attributeGroup = Mage::getModel('eav/entity_attribute_group')->getCollection() | |
->addFieldToFilter('attribute_set_id', array('eq' => $set->getId())) | |
->addFieldToFilter('attribute_group_name', array('eq' => 'General')) | |
->getFirstItem(); | |
$attribute->setAttributeSetId($attributeGroup->getAttributeSetId()); | |
$attribute->setAttributeGroupId($attributeGroup->getAttributeGroupId()); | |
$attribute->save(); | |
} | |
/* PHP Fatal error: Call to undefined method Mage_Eav_Model_Resource_Entity_Attribute::isUsedBySuperProducts() in /var/www/app/code/core/Mage/Catalog/Model/Entity/Attribute.php on line 86 */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment