From 990c9f946e6501648b5caaa1934570b8d607cf4e Mon Sep 17 00:00:00 2001 From: dinamiko Date: Thu, 28 Oct 2021 12:43:02 +0200 Subject: [PATCH] Add user needs to be logged in message when subscription in the cart --- composer.lock | 21 +++++++++---------- .../src/Checkout/DisableGateways.php | 7 +++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index 4e3fa6b9b..1c8ca84eb 100644 --- a/composer.lock +++ b/composer.lock @@ -735,16 +735,16 @@ }, { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -807,7 +807,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", @@ -2921,7 +2921,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-11-30T07:30:19+00:00" }, { @@ -3532,16 +3531,16 @@ }, { "name": "vimeo/psalm", - "version": "4.11.1", + "version": "4.11.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "e33492398bd4e5e2ab60e331d445979bd83feecd" + "reference": "6fba5eb554f9507b72932f9c75533d8af593688d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/e33492398bd4e5e2ab60e331d445979bd83feecd", - "reference": "e33492398bd4e5e2ab60e331d445979bd83feecd", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/6fba5eb554f9507b72932f9c75533d8af593688d", + "reference": "6fba5eb554f9507b72932f9c75533d8af593688d", "shasum": "" }, "require": { @@ -3629,7 +3628,7 @@ "inspection", "php" ], - "time": "2021-10-24T12:29:22+00:00" + "time": "2021-10-26T17:28:17+00:00" }, { "name": "webmozart/assert", diff --git a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php index cf4a7291d..20dab3d97 100644 --- a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php +++ b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php @@ -111,6 +111,13 @@ class DisableGateways { } if ( $this->subscription_helper->cart_contains_subscription() && ! is_user_logged_in() ) { + add_filter( + 'woocommerce_no_available_payment_methods_message', + function( $message ) { + return $message . '

' . esc_html__( 'PayPal payments needs you logged in to save the payment.', 'woocommerce-paypal-payments' ); + } + ); + return true; }