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 AshlinRejo/37f38d2bac9d99603ea54038a755ad99 to your computer and use it in GitHub Desktop.
Save AshlinRejo/37f38d2bac9d99603ea54038a755ad99 to your computer and use it in GitHub Desktop.
Woo Discount Rules: Composite product compatible
if(!function_exists('woo_discount_rules_exclude_cart_item_from_discount_method')){
function woo_discount_rules_exclude_cart_item_from_discount_method($status, $cart_item){
if(isset($cart_item['composite_item']) && !empty($cart_item['composite_item'])){
$status = true;
}
return $status;
}
}
add_filter('woo_discount_rules_exclude_cart_item_from_discount', 'woo_discount_rules_exclude_cart_item_from_discount_method', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment