Back Order customer notification does not show
@andrewbess is already working on this.
Since Apr 29, 2021.
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions (*)
Magento 2.4.1
MSI
### Steps to reproduce (*)
1. Create a product, add to source
2. Put QTY as -1 and Out of Stock Threshold as whatever you want (i.e. -20)
3. Add one to cart
4. Go to checkout page or cart page
### Expected result (*)
1. A message displays that says "We don't have as many quantity as you requested, but we'll back order the remaining ___"
### Actual result (*)
1. No message is displayed.
It seems that https://github.com/magento/inventory/pull/3143 created by @arnobsh broke backorder messaging in some cases. It doesn't take into account $stockItemData, and thus if the stock item qty is -1 and out of stock threshold is -20, it ends up with displayQty = 0, and thus doesn't display a backorder message. Salable Quantity is > 0, but stock available data is < 0 and thus should be displaying the stock available data's number as backorder number.



My suggestion would be to add
```
if ($backOrderQty < 0 && $requestedQty < $salableQty) {
$displayQty = $requestedQty;
}
```
to getDisplayQty
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.
Assessment
This issue has not been assessed yet.