Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › How to add 2 free products of the same SKU
Hi
I have a problem finding a way to add 2 free produkts (SAME SKU) on one coupon.
Have I overlooked how to do this?
Best Allan
Unfortunately you need to add a snippet to your CHILD THEME’s functions.php for that:
add_filter( 'wjecf_free_product_amount_for_coupon', function ( $amount, $coupon ) { if ( 0 === strcasecmp( $coupon->get_code(), 'THE_COUPON_CODE' ) ) $amount = 2; return $amount; }, 10, 2 );
Replace THE_COUPON_CODE by the actual coupon code.
I plan to make this possible out-of-the-box in a future version of the plugin; it has been requested multiple times.
It works fine, thanks..
And I’m looking forward for that upldate 🙂