Skip to content

Instantly share code, notes, and snippets.

@claudiu-marginean
Last active December 12, 2015 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save claudiu-marginean/4761344 to your computer and use it in GitHub Desktop.
Save claudiu-marginean/4761344 to your computer and use it in GitHub Desktop.
Update Product Attributes
<?php
/**
* This code only updates the attributes you want to change.
* The first paramater is an array of product IDs,
* the second is an array of attribute names and values,
* and then the third is the store ID you wish to update.
* This is MUCH faster than saving the entire model.
* Ref Link: http://stackoverflow.com/questions/3669211/saving-in-magento-taking-a-very-very-long-time
*/
Mage::getSingleton('catalog/product_action')
->updateAttributes(array($product->getId()), $attributesData, $storeId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment