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:
2 files changed
+15
-1
No files matched your search
@@ -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_(
|
return await this.atomicPhase_(
|
||||||
async (transactionManager: EntityManager) => {
|
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 (this.featureFlagRouter_.isFeatureEnabled("sales_channels")) {
|
||||||
if (config.validateSalesChannels) {
|
if (config.validateSalesChannels) {
|
||||||
@@ -900,6 +903,12 @@ class CartService extends TransactionBaseService {
|
|||||||
throw err
|
throw err
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (cart.shipping_methods?.length) {
|
||||||
|
await this.shippingOptionService_
|
||||||
|
.withTransaction(transactionManager)
|
||||||
|
.deleteShippingMethods(cart.shipping_methods)
|
||||||
|
}
|
||||||
|
|
||||||
cart = await this.retrieve(cart.id, {
|
cart = await this.retrieve(cart.id, {
|
||||||
relations: [
|
relations: [
|
||||||
"items.variant.product.profiles",
|
"items.variant.product.profiles",
|
||||||
|
|||||||
Reference in new issue
Block a user