Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Set Free Product Quantity › Reply To: Set Free Product Quantity
November 23, 2017 at 7:44 pm
#2194
Soft79
Keymaster
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;
}