Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Adding right amount of free product › Reply To: Adding right amount of free product
April 9, 2020 at 11:50 am
#15364
Soft79
Keymaster
– Tick BOGO matching products
– Tick Allow multiplication of the free products
– Use this snippet:
add_filter( 'wjecf_bogo_product_amount_for_coupon', function( $amount, $coupon ) {
if ( strcasecmp( $coupon->get_code(), 'COUPON_CODE_HERE' ) === 0 ) {
$amount = floor($amount / 12);
}
return $amount;
}, 10, 2 );