SHARE
TWEET

Untitled

a guest Jul 17th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $useConfigManageStock = '0';
  2. $manageStock = '0';
  3.  
  4. $collection->addAttributeToSelect('*')->load();
  5.  
  6. $customStock = ['use_config_manage_stock' => $useConfigManageStock, 'manage_stock' => $manageStock];
  7.  
  8. foreach ($collection as $product) {
  9.             $product->setStockData($customStock);
  10.             $product->save();
  11.         }
RAW Paste Data
Top