Exclude hidden child product in bundle compatibility for WooCommerce Product Bundles by SomewhereWar

Ensure compatibility with WooCommerce Product Bundles by excluding hidden child products from bundles.

add_filter('advanced_woo_discount_rules_process_cart_item_for_cheapest_rule', function($status, $item, $rule){
	 if( (isset($item['bundled_by']) && !empty($item['bundled_by']))){
        $status = false;
    }
    return $status;
}, 10, 3);
	
add_filter('advanced_woo_discount_rules_do_apply_price_discount', function ($apply, $price, $cart_item, $cart_object){
    if( (isset($cart_item['bundled_by']) && !empty($cart_item['bundled_by']))){
        $apply = false;
    }

    return $apply;
}, 10, 4);


add_filter('advanced_woo_discount_rules_include_cart_item_to_count_quantity', function($status, $cart_item, $type){
	if((isset($cart_item['bundled_by']) && !empty($cart_item['bundled_by']))){
        $status = false;
    }
    return $status;
}, 10, 3);