Magento Out-of-Stock Threshold setting to 0
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
There is some confusion on the design of the setting Out-of-Stock Threshold (related to backorders) especially around this setting having the value of zero. Backorders are enabled. There are 3 references to this setting and the value of zero.
Our assumption is that the 1st statement below should always be true when backorders are enabled. If the Out-of-Stock Threshold reaches 0 or is 0 or was set as 0. Then this means: the threshold was reached, there is no more stock.
However it seems two processes are being mixed into 1 setting. If the Out-of-Stock Threshold "reaches" 0 then Magento sets the product to out of stock (thus by order of the customer), but when the admin sets the value to 0 then in this case this means one can sell into infinity. This is a design flaw and hereby a bug. It needs to be fixed or crucial processes cannot continue.
References to the bug/issue
1. Here the value of the setting Out-of-Stock Threshold is explained especially for 0 values.
The text in the manual is "When the Salable Quantity reaches 0, the product is displayed as Out of Stock in the storefront."

2. Here the entry of the zero (0) value is explained. We assume the data needs to be entered in the admin? and dont know if this relates to API updates and stock imports too?
The text in the manual is "With Backorders enabled, entering 0 allows for infinite backorders."

3. In addition one could assume that this formula is NOT correct. It depends on how? the data is entered!

### Preconditions and Steps to reproduce(*)
1. Enable backorders
2. Set Out-of-Stock Threshold to -2
3. Buy 1 and then 1 more products
4. Product goes out of stock
5. Buy 1 more product not possible
This is OK
Compare to
1. Enable backorders
2. Set Out-of-Stock Threshold to 0
3. Buy 1 and then 1 more products
4. Product does not go out of stock
5. Buy 1 more product is possible!
This is NOK
Compare to
1. Enable backorders
2. Set Out-of-Stock Threshold to 0 and MSI STOCK = 2
3. Buy 1 and then 1 more products
4. Product does not go out of stock
5. Buy 1 more product is possible!
This is NOK
### Expected result (*)
1. Out-of-Stock Threshold set to 0 should *ALWAYS* result to 0 stock from backorders
It should not be used to hide some extra exceptional situation. 0 = 0
### Actual result (*)
1. In case 2 and 3 you end up with infinite sales
- [ X] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported backorder scenarios with an Out-of-Stock Threshold of -2 and 0, including MSI stock of 2, and compare the resulting salable quantity and storefront availability. Review the inventory backorder and threshold behavior to determine the intended meaning of zero; done means the documented and observed behavior agree and the zero-threshold case no longer permits unintended sales.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100