You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have different stock locations for my products, I can't check out 2 products that are stocked in different locations even when both locations are connected to the same sales channel.
I attached a public repository with a test that showcases the issue.
Expected behavior
Checking out items from different stock locations should work.
Package.json file
Node.js version
v22.11.0
Database and its version
PostgreSQL 16.2
Operating system name and version
MacOS Sonoma 14.6.1
Browser name
No response
What happended?
If I have different stock locations for my products, I can't check out 2 products that are stocked in different locations even when both locations are connected to the same sales channel.
I attached a public repository with a test that showcases the issue.
Expected behavior
Checking out items from different stock locations should work.
Actual behavior
The cart does not complete. I tracked it down to the following function:
https://github.com/medusajs/medusa/blob/v2.1.1/packages/core/core-flows/src/cart/utils/prepare-confirm-inventory-input.ts
In here all the stock locations are added to all the items even if each of the items are "contributing" different stock locations to the list.
Later this value is used here:
https://github.com/medusajs/medusa/blob/v2.1.1/packages/core/core-flows/src/cart/steps/reserve-inventory.ts
And we simply select the first location for all the items.
Link to reproduction repo
https://github.com/damianr13/medusa-cart-different-stock-locations
The text was updated successfully, but these errors were encountered: