Skip to content

Product quantity stock Not decrease when Order is placed #5945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adamraya opened this issue Aug 2, 2016 · 7 comments
Closed

Product quantity stock Not decrease when Order is placed #5945

adamraya opened this issue Aug 2, 2016 · 7 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@adamraya
Copy link

adamraya commented Aug 2, 2016

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.

@duhon duhon assigned duhon and unassigned duhon Aug 3, 2016
@magentodevleper
Copy link

magentodevleper commented Aug 4, 2016

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?

@dthampy dthampy self-assigned this Aug 4, 2016
@dthampy dthampy added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 4, 2016
@dthampy
Copy link
Contributor

dthampy commented Aug 4, 2016

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

@dthampy dthampy removed their assignment Aug 4, 2016
@janiscaunecm
Copy link

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 #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)

@JamboMedia
Copy link

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?

@anthony-blackbird
Copy link

Hello.

This bug is still existing, any update on this ?

@NadiyaS
Copy link
Contributor

NadiyaS commented Sep 15, 2016

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
Copy link
Contributor

NadiyaS commented Sep 15, 2016

This issue is closed as duplicate of #5222

@NadiyaS NadiyaS closed this as completed Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

9 participants