I am trying to update the stock quantities of products in Magento from within a script.
I load the product, set the stock quantity, and save - but the quantity remai
In my case I got the same problem with products that I've imported programmatically. I just realized that I forgot to add stock_data in the array...
'name' => $productName,
'stock_data' => array(
'use_config_manage_stock' => 0,
'manage_stock' => 0,
'qty' => 0,
'stock_id' => 1,
'min_qty' => 0,
)
Without stock data information, Magento generates an exception(at \Mage_CatalogInventory_Model_Stock_Item) when adding product to cart.
With this node, it works. =)