-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Allow negative stock levels for on-demand products #12536
Conversation
We weren't allowing negative stock to stop any bug from accidentally drawing too much stock. But now we want to implement a backordering logic that depends on negative stock levels to know how much is needed to replenish stock levels.
We weren't bothering with stock when items were on demand anyway. But we want to track stock now so that we can backorder more when local stock levels become negative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good idea to do this in a separate PR first.
Hey again @mkllnk , Tested the indicated scenarios:
Verified that:
I'm a bit unsure about this one, I'm probably misunderstanding this. How do we get an on-demand product out of stock? I did checkout on-demand variants, with no change of behavior, so I think we should be good. Please let me know if there is anything else you feel I should cover, on this specific scenario. Other than that, this looks good to me. Found nothing unusual. Please feel free to merge. |
Great, that's all good. It's a bit confusing but on-demand products still have a stock level. It's ignored during checkout and the shop doesn't show any stock levels, of course. But your screenshots look like you had a product with 0 stock that was set to on demand. That's what I meant with "out of stock" even though it's on demand. And the checkout still worked. 👍 |
ℹ️ Funded Feature. Please track ALL ASSOCIATED WORK under the associated tracking code #11678 DFC Orders
What? Why?
We want to place backorders on a wholesaler's platform when we run out of stock in our local OFN store. This complicates the stock logic though. To allow customers to order more than we have in stock, we set the products to on demand. And we change the logic to still count stock, allowing it to go negative, so that we know how much stock we need to order from the wholesaler.
This PR just prepares the change in OFN stock logic without adding the backordering logic. While it seems to be a fairly easy change, there's potential for subtle bugs around products going out of stock. We may have assumptions in our code that I'm not aware of.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates