Repository Forums Support WooCommerce Extended Coupon Features PRO set parent product of the variation as free gift when variation is in the cart Reply To: set parent product of the variation as free gift when variation is in the cart

#1274
Soft79
Keymaster

Try this:

Set both product A as product B as a free product in the coupon. Then use filter wjecf_set_free_product_amount_in_cart to change the amount of free products (set to zero if the product should not be applied).


add_filter( 'wjecf_set_free_product_amount_in_cart', function ( $quantity, $product_data ) {
// Logic here
}, 10, 2 );