Item Discounts Expression Language

42 views Asked by At

I have a promotion with the following condition to apply only if order total is above $500:

lineItems.sum(lineItem.subtotal) > 500

Issue: If there is an item with a discount promotion (e.g. $10 discount) and the total is $501, this condition will still pass even though the actual order total is $491. ($501 - $10).

Question: How do I write the condition so that the totals deduct the discounts? In other words, what is the expression language syntax for discounts? (which I wrote below as discounts_total) What is the correct expression for sum of line item discounts?

fake example below:

lineItems.sum(lineItem.subtotal) - (discounts_total) > 500
                                   ^^^^^^^^^^^^^^^^^
0

There are 0 answers