Skip to content

Instantly share code, notes, and snippets.

@lukluk
Created January 22, 2014 02:51
Show Gist options
  • Save lukluk/8552706 to your computer and use it in GitHub Desktop.
Save lukluk/8552706 to your computer and use it in GitHub Desktop.
Update Attribute Value
$productCollection = Mage::getModel('catalog/product')->getCollection();
foreach($productCollection as $_product)
{
echo "\n".'updating '.$_product->getSku()."...\n";
$product = Mage::getModel('catalog/product')->load($_product->getEntityId());
$product->setData('add_ten_pence', 1)->getResource()->saveAttribute($product, 'add_ten_pence');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment