We have multiple warehouses for our web-store and we want to update stock via script whenever we get new stock in. However, when I try to update the stock level via program, the stock level goes up superficially but stock in the warehouse remains to show "0". This is a major problem and creates stock issues in our website.
I am attaching a snapshot for you to see what the issue is:
As you can see, the stock itself within the Product attributes state it is 22, however it's value within the warehouse stock = 0. How can I go about updating the stock value in the specific warehouse programmatically?
When I try to update stock via the following code :
$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($xyzModel->getId()); $stockItem->setData('qty', $newQty); $stockItem->setData('is_in_stock', $newInStock); $stockItem->save();
It only updates the stock superficially, as shown in the photo.
Any help would be appreciated. Thanks in advance!