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
When you remove something from your shopping cart the shipping method should be deleted because it needs to be recalculated. This bug can lead to cases where the shipping costs are too low or too high. To prevent this from happening you want the shipping methods to be deleted when an item is added or removed to the cart.
For the removal of an item there is code that does this but it never gets called because "shipping_methods" is never fetched from the database. E.g. this line of code can never be reached because "shipping_methods" is not retrieved
Note that adding an item or updating an item in the cart should also remove the shipping method from the cart. There is currently no code that does this.
System information
Medusa version (including plugins): 1.13.1-beta-20230727162508 (i checked and the bug is also in the latest non beta version)
Node.js version: v20.2.0
Database: Postgres
Operating system: MacOS
Steps to reproduce the behavior
Set up a shipping method that calculates the price based on the items in the cart
Put something in your cart
Go to checkout
Fill out shipping address and calculate the shipping price
Go back to the store and add another item to the cart
Go back to checkout
Shipping price is still based on the old items in the cart from step 4.
Expected behavior
Set up a shipping method that calculates the price based on the items in the cart
Put something in your cart
Go to checkout
Fill out shipping address and calculate the shipping price
Go back to the store and add another item to the cart
Go back to checkout
Shipping price is recalculated based on the new cart
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
When you remove something from your shopping cart the shipping method should be deleted because it needs to be recalculated. This bug can lead to cases where the shipping costs are too low or too high. To prevent this from happening you want the shipping methods to be deleted when an item is added or removed to the cart.
For the removal of an item there is code that does this but it never gets called because "shipping_methods" is never fetched from the database. E.g. this line of code can never be reached because "shipping_methods" is not retrieved
medusa/packages/medusa/src/services/cart.ts
Line 493 in efdea04
Note that adding an item or updating an item in the cart should also remove the shipping method from the cart. There is currently no code that does this.
System information
Medusa version (including plugins): 1.13.1-beta-20230727162508 (i checked and the bug is also in the latest non beta version)
Node.js version: v20.2.0
Database: Postgres
Operating system: MacOS
Steps to reproduce the behavior
Expected behavior
The text was updated successfully, but these errors were encountered: