Compatible with Upfront payment for WooCommerce Subscriptions

Compatible with Upfront payment for WooCommerce Subscriptions

if(!function_exists('woo_discount_rules_has_price_override_method')){
    function woo_discount_rules_has_price_override_method($hasPriceOverride, $product, $run_on, $cart_item){
        if(isset($cart_item['flycart_wcs_pay_upfront']) && $cart_item['flycart_wcs_pay_upfront']){
            $hasPriceOverride = true;
        }
        
        return $hasPriceOverride;
    }
}

add_filter('woo_discount_rules_has_price_override', 'woo_discount_rules_has_price_override_method', 10, 4);