Last active
July 18, 2018 00:45
-
-
Save mokanfar/d43374bd7891c341f9f9cad61d6973e6 to your computer and use it in GitHub Desktop.
Magento update from list of skus an attribute programatically
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_once 'app/Mage.php'; | |
Mage::app(); | |
$skus = array("ARRAY OF SKUS HERE"); | |
$n=array(); | |
foreach ($skus as $item) { | |
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $item)->getId(); | |
array_push($n, $product); | |
} | |
Mage::getSingleton('catalog/product_action')->updateAttributes($n, array('notes' => 'foo'), Mage_Core_Model_App::ADMIN_STORE_ID); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment