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

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #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…

    #15535
    Soft79
    Keymaster

    …it has a catch though, if the selected free item is also in the cart as non-free the non-free item also gets a free price. Please contact the developer of the advanced pricing plugin if he knows a workaround. I advice you to share the last snippet so he will understand what it going on.

    #15536
    Bart van Doveren
    Participant

    OK, thanks

    #15537
    Soft79
    Keymaster

    Oh, I just saw that the Pricing plugin has this setting on it’s “Calculation”-page:

    “Use prices modified by other plugins”

    Enable it, and you won’t even need the last snippet.

    #15538
    Bart van Doveren
    Participant

    YES – that seems to work just right!
    Thanks a lot for your support, really appreciated.

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.