Skip to content

Instantly share code, notes, and snippets.

@webprom
Forked from woogist/functions.php
Last active August 29, 2015 14:21
Show Gist options
  • Save webprom/9a753c1604b0635574cd to your computer and use it in GitHub Desktop.
Save webprom/9a753c1604b0635574cd 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment