Browse Source

fix(core): Filter Promotions on Channel before applying to Order

hendrikdepauw 4 years ago
parent
commit
0cb29e5d22
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/core/src/service/services/order.service.ts

+ 3 - 3
packages/core/src/service/services/order.service.ts

@@ -1345,9 +1345,9 @@ export class OrderService {
                 item.listPriceIncludesTax = priceResult.priceIncludesTax;
             }
         }
-        const promotions = await this.connection.getRepository(ctx, Promotion).find({
-            where: { enabled: true, deletedAt: null },
-            order: { priorityScore: 'ASC' },
+        const { items: promotions } = await this.promotionService.findAll(ctx, {
+            filter: { enabled: { eq: true } },
+            sort: { priorityScore: 'ASC' },
         });
         const updatedItems = await this.orderCalculator.applyPriceAdjustments(
             ctx,