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
April 18, 2017 at 7:49 pm
#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 );