Last active
December 12, 2015 10:48
-
-
Save claudiu-marginean/4761344 to your computer and use it in GitHub Desktop.
Update Product Attributes
This file contains hidden or 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 | |
/** | |
* 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