Created
April 18, 2024 09:31
-
-
Save sarancartrabbit/3f990cc6a6fddd894509fba509c8821e to your computer and use it in GitHub Desktop.
Woo Discount Rules: Exclude discount for the backorder product
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('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