In Craft Commerce 3, there is a Order Condition Formula that allow us to condition for the discount. So here is my Case.
- I have product A and Product B, so I will give a discount to Product A if the costumer buy 3 of Products B.
I tried to use this formula
order.lineItems|filter(v => (v.sku == 'SKU A' and qty >= 3) )
but the filter is not allowed in this formula, so is there any other way to approach this?