Created
July 8, 2015 10:02
-
-
Save lucasstark/ffd057dd57843a9399fe to your computer and use it in GitHub Desktop.
Exclude Products from Dynamic Pricing Global Discounts
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', 'wcdp_exclude_specific_products', 10, 2 ); | |
function wcdp_exclude_specific_products( $include, $product ) { | |
//Adjust this array accordingly. Alternatively use a product category. | |
$products_to_exclude = array( | |
1, | |
101, | |
717 | |
); | |
if ( in_array( $product->id, $products_to_exclude ) ) { | |
$include = false; | |
} | |
return $include; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment