Skip to content

Instantly share code, notes, and snippets.

@woogist
Created May 8, 2015 07:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogist/2b1b66d1569fbb7119f9 to your computer and use it in GitHub Desktop.
Save woogist/2b1b66d1569fbb7119f9 to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) {
remove_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
if ( $product->is_on_sale() ) {
$eligible = false;
}
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'is_product_eligible', 10, 4 );
return $eligible;
}
@Rana858
Copy link

Rana858 commented Sep 29, 2019

Hello,

how i can exclude Product Add-Ons from dynamic pricing using your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment