Skip to content

Instantly share code, notes, and snippets.

@sandermangel
Created November 13, 2014 08:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandermangel/46d14df8f4ebf06acfee to your computer and use it in GitHub Desktop.
Save sandermangel/46d14df8f4ebf06acfee to your computer and use it in GitHub Desktop.
[Magento] Save product data in a loop without loading the whole object
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('name');
foreach ($collectio as $product)
{
$product->setName("Here goes the name");
$product->getResource()->saveAttribute($product, 'name');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment