Last active
May 31, 2021 13:52
-
-
Save Balakrishnan-flycart/ec47460218611267803cfdca3dc21e5a to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Remove discount for product
This file contains hidden or 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){ | |
if( class_exists('\Wdr\App\Helpers\Woocommerce')){ | |
$product_id = \Wdr\App\Helpers\Woocommerce::getProductId($product); | |
if(in_array($product_id, array(1, 2, 3 ))){ // 1,2,3 is given product id | |
return false; | |
} | |
} | |
return $filter_passed; | |
}, 10, 5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment