Exclude child products compatibility for WooCommerce Chained Products

Exclude child products with WooCommerce Chained Products compatibility.

add_filter('advanced_woo_discount_rules_calculate_discount_for_cart_item', function ($calculate_discount, $cart_item){
    if(isset($cart_item['chained_item_of']) && !empty($cart_item['chained_item_of'])){
        $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['chained_item_of']) && !empty($cart_item['chained_item_of'])){
        $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['chained_item_of']) && !empty($cart_item['chained_item_of'])){
        $calculate_discount = false;
    }
    return $calculate_discount;
}, 100, 2);