fix(medusa): removal of shipping methods on addOrUpdateLineItems (#4725)
* added removal of shipping methods on addOrUpdateLineItems * Create lovely-beds-design.md --------- Co-authored-by: Thijs Simons <thijs@careeraim.nl> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
5
.changeset/lovely-beds-design.md
Normal file
5
.changeset/lovely-beds-design.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): removal of shipping methods on addOrUpdateLineItems
|
||||
@@ -765,7 +765,10 @@ class CartService extends TransactionBaseService {
|
||||
|
||||
return await this.atomicPhase_(
|
||||
async (transactionManager: EntityManager) => {
|
||||
let cart = await this.retrieve(cartId, { select })
|
||||
let cart = await this.retrieve(cartId, {
|
||||
select,
|
||||
relations: ["shipping_methods"]
|
||||
})
|
||||
|
||||
if (this.featureFlagRouter_.isFeatureEnabled("sales_channels")) {
|
||||
if (config.validateSalesChannels) {
|
||||
@@ -900,6 +903,12 @@ class CartService extends TransactionBaseService {
|
||||
throw err
|
||||
})
|
||||
|
||||
if (cart.shipping_methods?.length) {
|
||||
await this.shippingOptionService_
|
||||
.withTransaction(transactionManager)
|
||||
.deleteShippingMethods(cart.shipping_methods)
|
||||
}
|
||||
|
||||
cart = await this.retrieve(cart.id, {
|
||||
relations: [
|
||||
"items.variant.product.profiles",
|
||||
|
||||
Reference in New Issue
Block a user