-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Product query doesn't refer only to current channel stock location #2356
Comments
Thanks for the report. This behaviour is the responsibility of the
By default, Vendure uses the
You can see the source here: https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/config/catalog/default-stock-location-strategy.ts#L28 So technically what you report is "working as intended" but yeah, we should probably look at what we can do better here. I see the following options:
Doing 3 would be a breaking change so I'm going to look into 4. |
Thanks for the detailed explanation! |
Fixes #2356. This commit introduces a much more sophisticated stock location strategy that takes into account the active channel, as well as available stock levels in each available StockLocation. With v3.1.0 it will become the default strategy.
Fixes #2356. This commit introduces a much more sophisticated stock location strategy that takes into account the active channel, as well as available stock levels in each available StockLocation. With v3.1.0 it will become the default strategy.
We have a multi channel - multi sellers setup, where every seller relies on a different stock location.
When querying a product there is an unexpected behaviour regarding the stockLevel, that seems to take into account not only the current channel stock location, but also all the others. If there are no saleable units in the current stock location, but they are still available in other locations, the product query will return IN_STOCK.
To Reproduce
channel-A
andchannel-B
stock-A
andstock-B
out-of-stock-threshold
is set to 0 as defaultchannel-A
refers only tostock-A
, same for the otherstock-A
to 0stock-B
to 10channel-A
and check forstockLevel
stockLevel: IN_STOCK
channel-A
, and even to fullfill the order, leading to a negative stock amount.Expected behavior
The query should return
stockLevel: OUT_OF_STOCK
, sincestock-A
has been set to zero.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: