Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Balakrishnan-flycart/ec47460218611267803cfdca3dc21e5a to your computer and use it in GitHub Desktop.
Save Balakrishnan-flycart/ec47460218611267803cfdca3dc21e5a to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Remove discount for product
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