Repository Forums Support WooCommerce Extended Coupon Features PRO 2 Free with any purchase Reply To: 2 Free with any purchase

#3689
Soft79
Keymaster

You can achieve that with this filter:

add_filter( 'wjecf_free_product_amount_for_coupon', function ( $amount, $coupon ) {
  if ( $coupon->get_code() == 'COUPON_CODE_HERE' ) {
    $amount = 2;
  }
  return $amount;
}, 10, 2 );

Please replace COUPON_CODE_HERE by the actual coupon code (lower case).