Repository Forums Support WooCommerce Extended Coupon Features PRO Free products quantity not added to cart Reply To: Free products quantity not added to cart

#3584
Soft79
Keymaster

Ok, two things:

– With your current configuration one free item can be added for every 12 products in the cart. I.e. if 24 items are in the cart, the customer can add two free items. Paste this snippet in your child theme’s functions.php to change this behaviour (untested):


add_filter(
  'wjecf_free_product_amount_for_coupon',
  function ( $amount, $coupon ) { 
    if ( $coupon->get_code() === 'disneytest2' && $amount >= 1 ) { 
      $amount = WJECF()->get_quantity_of_matching_products( $coupon, $wc_discounts ); 
    }
    return $amount;
  }, 10, 2
);

– The form is currently configured to auto-apply which doesn’t work really well in your case. Try this:

1. Copy plugins/woocommerce-auto-added-coupons-pro/templates/cart/select-free-product.php to themes/YOUR-CHILD-THEME/woocommerce-auto-added-coupons/cart/select-free-product.php
2. In the copied file (in your child theme) search the text wjecf-auto-submit and remove it.