From 3803ba935c678a08dd576d0340e2b4c6f4a1ed0c Mon Sep 17 00:00:00 2001 From: David Remer Date: Fri, 11 Sep 2020 15:05:30 +0300 Subject: [PATCH] make sure user is logged in when detecting the buyer-country in debug mode --- modules/ppcp-button/src/Assets/class-smartbutton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/class-smartbutton.php b/modules/ppcp-button/src/Assets/class-smartbutton.php index a1ed60cb5..551894c81 100644 --- a/modules/ppcp-button/src/Assets/class-smartbutton.php +++ b/modules/ppcp-button/src/Assets/class-smartbutton.php @@ -681,7 +681,7 @@ class SmartButton implements SmartButtonInterface { $this->settings->get( 'intent' ) : 'capture', ); if ( - defined( 'WP_DEBUG' ) && \WP_DEBUG + defined( 'WP_DEBUG' ) && \WP_DEBUG && is_user_logged_in() && WC()->customer && WC()->customer->get_billing_country() ) { $params['buyer-country'] = WC()->customer->get_billing_country();