Hello,
usually we have only 1 product in stock so we didn't see the problem before.
But, the product quantity becomes 0 after shipping even if original quantity is greater than 2.
A simple test with configurable product : got 3 items for the red color.
Buying 1 of them, validate all the order and quantity in backend is 0 after that (after ship)
Magento version is 2.4.3
Thanks a lot.
By default, that should not happen, so you must have some custom code or extension that is causing the issue.
Nobody can help you without looking into your specific codebase.
Also, if you have multisource inventory, read this to understand the difference between quantity and salable quantity - https://www.linkedin.com/feed/update/urn:li:activity:7216048740120338432/
I finaly solved my problem with this :
https://github.com/AmpersandHQ/magento2-disable-stock-reservation?tab=readme-ov-file
Thanks.
Hello @contactilo2294,
you're experiencing an issue where product quantity is incorrectly reduced to 0 after shipping in Magento 2.4.3, even though there is still stock available. This behavior could be caused by a few different factors, including inventory settings, stock management, or a bug.
Steps to Diagnose and Resolve:
Check Stock Settings for Configurable Products:
Catalog > Products > [Your Configurable Product]:
For the configurable product, make sure that the "Stock Status" and "Quantity" fields are properly set and are not linked directly to the simple product. Magento manages inventory at the simple product level for configurable products.
Inventory Tab of the simple product (e.g., red color):
Ensure that the "Manage Stock" is set to Yes and "Qty" is correctly configured for the simple product.
Check that "Out-of-Stock Threshold" is set to a sensible value (like 0).
Review Global Inventory Configuration:
Go to Stores > Configuration > Catalog > Inventory and review the following settings:
Decrement Stock When Order is Placed: This should typically be set to Yes. If it's set to No, it may cause unexpected stock behavior.
Display Out-of-Stock Products: Ensure this setting is configured based on how you want to handle out-of-stock products.
Backorders: If backorders are enabled, double-check that they are set up correctly and aren't allowing sales beyond available stock.
Verify Inventory Reservations: Magento 2.3+ uses the MSI (Multi-Source Inventory) system, which includes stock reservations. Sometimes, these reservations can cause unexpected behavior. Here's how to check and resolve this:
Run the following SQL query to see if there are pending stock reservations:
SELECT * FROM inventory_reservation WHERE sku = 'YOUR_PRODUCT_SKU';
Additionally, check for any reservations that were not cleared properly after shipment.
Check for Customizations or Extensions:
Steps to Test:
Check if the quantity of the simple product in the backend is correctly reduced by 1 instead of dropping to 0.
If the issue will be resolved, Click Kudos & Accept as a Solution.
It is like an issue with the inventory settings or a possible bug. Double-check if the "deduct stock" option is correctly configured in your system. Sometimes adjusting the stock management and Custom Woodwork rules can help resolve such discrepancies.