Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Free product choice in combination with Advanced Dynamic Pricing For Woocommerc › Reply To: Free product choice in combination with Advanced Dynamic Pricing For Woocommerc

#15534
Soft79
Keymaster

Yeah, I just saw it.


add_filter( 'wdp_get_product', function ( $product, $item ) {
	if ( isset( $item['_wjecf_free_product_coupon'] ) ) {
		$product->set_price(0);
	}
	return $product;
}, 10, 2);

This works better…