From 653f79b25b79f953af04a4d1cf28f34ba5c862c9 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 22 Apr 2016 15:03:10 -0300 Subject: [PATCH] Fixed method retuning value in write context in includes/class-wc-checkout.php --- includes/class-wc-checkout.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index ac19cd03099..6e030441fd0 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -563,8 +563,9 @@ class WC_Checkout { } if ( WC()->cart->needs_shipping() ) { + $shipping_country = WC()->customer->get_shipping_country(); - if ( empty( WC()->customer->get_shipping_country() ) ) { + if ( empty( $shipping_country ) ) { wc_add_notice( __( 'Please enter an address to continue.', 'woocommerce' ), 'error' ); } elseif ( ! in_array( WC()->customer->get_shipping_country(), array_keys( WC()->countries->get_shipping_countries() ) ) ) { wc_add_notice( sprintf( __( 'Unfortunately we do not ship %s. Please enter an alternative shipping address.', 'woocommerce' ), WC()->countries->shipping_to_prefix() . ' ' . WC()->customer->get_shipping_country() ), 'error' );