Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarancartrabbit/3f990cc6a6fddd894509fba509c8821e to your computer and use it in GitHub Desktop.
Save sarancartrabbit/3f990cc6a6fddd894509fba509c8821e to your computer and use it in GitHub Desktop.
Woo Discount Rules: Exclude discount for the backorder product
add_filter('advanced_woo_discount_rules_filter_passed', function ($filter_passed, $rule, $product, $sale_badge, $product_table, $conditionFailed) {
if(is_object($product) && method_exists($product, 'is_on_backorder')){
if($product->is_on_backorder()){
return false;
}
}
return $filter_passed;
}, 10, 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment