Created
May 8, 2015 07:02
-
-
Save woogist/2b1b66d1569fbb7119f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Anyone getting this to work? It's not working whatsoever for me. This basically craches my site (it becomes so slow it's unsuable).
I tried changing the code but it didnt help. Basically I got sale products that I don't want the dynamic discount on (I am using this together with user role editor to give roles %-discount). Any ideas?
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
We have applied 10% off all "priced individually" subproducts of a bundle. Dynamic pricing applies its own discount on top of the 10% off. But I want to only discount the dynamic pricing off the true individual retail price, not the 10% off price. How can I go about doing that?