Skip to content
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

After Shipping Qty added to out of stock item #86

Open
phes71 opened this issue Nov 1, 2022 · 2 comments
Open

After Shipping Qty added to out of stock item #86

phes71 opened this issue Nov 1, 2022 · 2 comments

Comments

@phes71
Copy link

phes71 commented Nov 1, 2022

The following steps update item qty

Item is set to Manage stock > NO
Customer purchases qty of items
Admin changes Manage stock to YES and sets to out of stock
Item is shown out of stock.

Admin ships order
Item qty is set to the same qty that has been shipped and now the item is in stock

@phes71
Copy link
Author

phes71 commented Nov 14, 2022

The scenario was that a customer purchased an item and on fulfilling the order used the last stock.
As the item was set to not manage stock this was changed to manage stock and qty to 0, out of stock
When the item was shipped the product qty increased to match the shipped qty.

The saleable qty didn't change but the qty of the product in admin did, causing confusion

This only happens with the following procedure
1: Item is set to Manage stock > NO
2: Customer purchases qty of items
3: Admin changes Manage stock to YES and sets to out of stock
Item is shown out of stock.
4:Admin ships order

It seems this code adds the qty
Magento\InventoryCatalog\Model\ResourceModel\SetDataToLegacyStockItem.php

when I comment out line 49, the products are not set so no qty gets updated after shipping
//$productIds = $this->getProductIdsBySkus->execute([$sku]);

    if (isset($productIds[$sku])) {

@tr33m4n
Copy link
Contributor

tr33m4n commented Feb 9, 2024

Hi @phes71, is this still an issue? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants