diff --git a/packages/core/src/entity/shipping-line/shipping-line.entity.ts b/packages/core/src/entity/shipping-line/shipping-line.entity.ts index c447e9af24..2c57cdcaa4 100644 --- a/packages/core/src/entity/shipping-line/shipping-line.entity.ts +++ b/packages/core/src/entity/shipping-line/shipping-line.entity.ts @@ -88,7 +88,7 @@ export class ShippingLine extends VendureEntity { this.adjustments = this.adjustments.concat(adjustment); } - removeAdjustments() { + clearAdjustments() { this.adjustments = []; } diff --git a/packages/core/src/service/helpers/order-calculator/order-calculator.ts b/packages/core/src/service/helpers/order-calculator/order-calculator.ts index d8eeecca64..2a86c90e9f 100644 --- a/packages/core/src/service/helpers/order-calculator/order-calculator.ts +++ b/packages/core/src/service/helpers/order-calculator/order-calculator.ts @@ -349,7 +349,7 @@ export class OrderCalculator { p.test(ctx, order).then(Boolean), ); if (applicableOrderPromotions.length) { - order.shippingLines.forEach(line => (line.adjustments = [])); + order.shippingLines.forEach(line => line.clearAdjustments()); for (const promotion of applicableOrderPromotions) { // re-test the promotion on each iteration, since the order total // may be modified by a previously-applied promotion @@ -365,9 +365,10 @@ export class OrderCalculator { } } } else { - // If there is no applicable promotion for shipping, we should remove already assigned adjustment from shipping lines. + // If there is no applicable promotion for shipping, + // we should remove already assigned adjustment from shipping lines. for (const shippingLine of order.shippingLines) { - shippingLine.removeAdjustments(); + shippingLine.clearAdjustments(); } } }