Last active
May 27, 2022 07:04
-
-
Save AnanthFlycart/4cfedcf64c8a518c405ff66321f89266 to your computer and use it in GitHub Desktop.
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
| // Exclude child products compatibility for WooCommerce Product Bundles (by SomewhereWarm and WooCommerce) | |
| add_filter('advanced_woo_discount_rules_calculate_discount_for_cart_item', function ($calculate_discount, $cart_item){ | |
| if(isset($cart_item['bundled_item_id']) && !empty($cart_item['bundled_item_id'])){ | |
| $calculate_discount = false; | |
| } | |
| return $calculate_discount; | |
| }, 100, 2); | |
| add_filter('advanced_woo_discount_rules_include_cart_item_to_count_quantity', function($take_count, $cart_item){ | |
| if(isset($cart_item['bundled_item_id']) && !empty($cart_item['bundled_item_id'])){ | |
| $take_count = false; | |
| } | |
| return $take_count; | |
| }, 100, 2); | |
| add_filter('advanced_woo_discount_rules_process_cart_item_for_cheapest_rule', function($calculate_discount, $cart_item){ | |
| if(isset($cart_item['bundled_item_id']) && !empty($cart_item['bundled_item_id'])){ | |
| $calculate_discount = false; | |
| } | |
| return $calculate_discount; | |
| }, 100, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment