Was not taking into account existing promotions previously.
@@ -26,7 +26,7 @@ export const discountOnItemWithFacets = new PromotionItemAction({
},
async execute(orderItem, orderLine, args) {
if (await facetValueChecker.hasFacetValues(orderLine, args.facets)) {
- return -orderLine.unitPrice * (args.discount / 100);
+ return -orderItem.unitPriceWithPromotions * (args.discount / 100);
}
return 0;
@@ -26,7 +26,7 @@ export const productsPercentageDiscount = new PromotionItemAction({
execute(orderItem, orderLine, args) {
if (lineContainsIds(args.productVariantIds, orderLine)) {