Procházet zdrojové kódy

docs: Fix free gift action example

Michael Bromley před 3 roky
rodič
revize
998daba24c
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      docs/content/developer-guide/promotions.md

+ 3 - 1
docs/content/developer-guide/promotions.md

@@ -190,7 +190,9 @@ export const freeGiftAction = new PromotionItemAction({
     // This part is responsible for ensuring the variants marked as 
     // "free gifts" have their price reduced to zero.  
     if (lineContainsIds(args.productVariantIds, orderLine)) {
-      const unitPrice = orderLine.unitPrice;
+      const unitPrice = orderLine.productVariant.listPriceIncludesTax
+        ? orderLine.unitPriceWithTax
+        : orderLine.unitPrice;
       return -unitPrice;
     }
     return 0;