Fixed method retuning value in write context in includes/class-wc-checkout.php

This commit is contained in:
Claudio Sanches 2016-04-22 15:03:10 -03:00
parent 0f801ed701
commit 653f79b25b
1 changed files with 2 additions and 1 deletions

View File

@ -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 <strong>we do not ship %s</strong>. Please enter an alternative shipping address.', 'woocommerce' ), WC()->countries->shipping_to_prefix() . ' ' . WC()->customer->get_shipping_country() ), 'error' );