Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Set Free Product Quantity
Hi, I’m unable to find the free product quantity option. What I want if user applied “CUP10” coupon it will add the 10 free product in cart and not apply the discount. But there is no such option in plugin.
Hi,
You can achieve that by adding this snippet to your child themes functions.php:
add_filter( 'wjecf_free_product_amount_for_coupon', 'wjecf_free_product_amount_for_coupon', 10, 2 ); function wjecf_free_product_amount_for_coupon( $amount, $coupon ) { if ( strtolower( $coupon->get_code() ) == 'cup10' && $amount >= 1 ) { $amount = 10; } return $amount; }