make sure user is logged in when detecting the buyer-country in debug mode

This commit is contained in:
David Remer 2020-09-11 15:05:30 +03:00
parent 9e2f1f4bf9
commit 3803ba935c

View file

@ -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();