2

We will need to uncomment this line to allow |filter used in condition formulas: https://github.com/craftcms/commerce/blob/develop/src/services/Formulas.php#L198 If you do that manually yourself this formula works: order.lineItems|filter(v => (v.sku == 'BBB' and v.qty >= 3) ) You were missing the v. in front of qty. Look in the next version of commerce ...


1

The Commerce GUI doesn't let you set a whole cart discount but you can do it as an adjuster in a module/plugin. Setup the scaffolding for a module at pluginfactory then add a folder inside called the src folder adjusters and name it OrderAdjuster.php Throw this code in that file (modified from a another project): <?php namespace modules\yourmodule\...


1

Found the answer: in both discounts "Don’t apply any subsequent discounts to an order if this discount is applied" has to be active. and the discount with the higher value (in my case > 200$ -> 10%) has to be above the other discount in the control panel. and to check on the page itself, use the "update cart" button and not the ...


1

I have now updated this code for Craft Commerce 2: {% set codeError = null %} {% set cartProductIds = [] %} {% set discountCodeOK = null %} {# THIS CHECKS THE DISCOUNT CODE FOR IF THERE ARE ANY VALID/ELIGIBLE PRODUCTS IN THE CART #} {% set currentDiscount = craft.commerce.discounts.discountByCode(cart.couponCode) %} {% if currentDiscount %} {% for item in ...


Only top voted, non community-wiki answers of a minimum length are eligible