magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Product quantity stock Not decrease when Order is placed

Open adamraya opened this issue 10 years ago • 7 comments

I created several products via backend using Magento CE 2.0.2, I upgraded to Magento CE 2.1, when I place an order on those products created on Magento CE 2.0.2, quantity not decrease. However on new products created via backend Magento CE 2.1 it's working fine.

No messages are being displayed to show why the stock is not being lowered. The magento debug and system logs show no real issues.

Steps to reproduce

  1. Create a product via backend on Magento CE 2.0.2
  2. Upgrade to Magento CE 2.1
  3. Place an order on those products previously created using Magento CE 2.0.2

Expected result

The quantity should decrease.

Actual result

The quantity is not being lowered.

adamraya avatar Aug 02 '16 17:08 adamraya

We are facing the same issue with our website. We upgraded our website to Magento 2.1 from 2.0.4. While placing an order, the product quantity is not decreased. It remains the same.

This is causing a huge trouble managing stock. Does any one have an update on this and the cause for it?

magentodevleper avatar Aug 04 '16 10:08 magentodevleper

internal jira ticket -MAGETWO-56448 has been created for this issue

dthampy avatar Aug 04 '16 23:08 dthampy

This happens because of change in app/code/Magento/CatalogInventory/Model/Configuration.php.

When you save a product, it's stock item gets created and saved in DB with a website_id assigned. Previously this would take current website's ID, now it is hardcoded to zero.

As a result, there may be stock items for product that have website_id != 0 and since now Magento searches for the ones with website_id=0, those will never get updated.

This whole website scope stock management seems to be a big mess, especially since according to this https://github.com/magento/magento2/issues/473 it was not supposed to be there.

There is no easy fix since you'd need to a) convert all stock items to have website_id=0 b) make sure Magento only uses website_id=0 for future queries and future stock items (might be fixed in 2.1 though)

janiscaunecm avatar Aug 17 '16 15:08 janiscaunecm

Same problem over here. Updated to Magento 2.1, after that the stock is not decreasing.

Will this be fixed in Magento 2.1.1?

JamboMedia avatar Aug 24 '16 08:08 JamboMedia

Hello.

This bug is still existing, any update on this ?

anthony-blackbird avatar Sep 07 '16 08:09 anthony-blackbird

Hi, this issue was already fixed and will be delivered soon, for now you can use quick fix : Run MySQL query update cataloginventory_stock_item set website_id = 0 where website_id = 1; and then run in CLI php bin/magento index:reindex cataloginventory_stock.

NadiyaS avatar Sep 15 '16 13:09 NadiyaS

This issue is closed as duplicate of #5222

NadiyaS avatar Sep 15 '16 13:09 NadiyaS