Sfoglia il codice sorgente

docs: Fix a couple of typos

Michael Bromley 1 anno fa
parent
commit
c965ce5ae3
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      docs/docs/guides/core-concepts/promotions/index.md

+ 2 - 2
docs/docs/guides/core-concepts/promotions/index.md

@@ -264,7 +264,7 @@ It is possible to establish dependency relationships between a PromotionAction a
 For example, if we want to set up a "buy 1, get 1 free" offer, we need to:
 For example, if we want to set up a "buy 1, get 1 free" offer, we need to:
 
 
 1. Establish whether the Order contains the particular ProductVariant under offer (done in the PromotionCondition)
 1. Establish whether the Order contains the particular ProductVariant under offer (done in the PromotionCondition)
-2. Apply a discount to the qualifying OrderItem (done in the PromotionAction)
+2. Apply a discount to the qualifying OrderLine (done in the PromotionAction)
 
 
 In this scenario, we would have to repeat the logic for checking the Order contents in _both_ the PromotionCondition _and_ the PromotionAction. Not only is this duplicated work for the server, it also means that setting up the promotion relies on the same parameters being input into the PromotionCondition and the PromotionAction.
 In this scenario, we would have to repeat the logic for checking the Order contents in _both_ the PromotionCondition _and_ the PromotionAction. Not only is this duplicated work for the server, it also means that setting up the promotion relies on the same parameters being input into the PromotionCondition and the PromotionAction.
 
 
@@ -285,7 +285,7 @@ export const buy1Get1FreeAction = new PromotionItemAction({
     execute(ctx, orderLine, args, state) {
     execute(ctx, orderLine, args, state) {
         // highlight-next-line
         // highlight-next-line
         const freeItemIds = state.buy_x_get_y_free.freeItemIds;
         const freeItemIds = state.buy_x_get_y_free.freeItemIds;
-        if (idsContainsItem(freeItemIds, orderItem)) {
+        if (idsContainsItem(freeItemIds, orderLine)) {
             const unitPrice = ctx.channel.pricesIncludeTax ? orderLine.unitPriceWithTax : orderLine.unitPrice;
             const unitPrice = ctx.channel.pricesIncludeTax ? orderLine.unitPriceWithTax : orderLine.unitPrice;
             return -unitPrice;
             return -unitPrice;
         }
         }