When only selling to one country set customer location to that country
This commit is contained in:
parent
ac80e6683e
commit
ebea6b96be
|
@ -1079,7 +1079,8 @@ function wc_get_customer_default_location() {
|
|||
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
|
||||
break;
|
||||
default:
|
||||
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', '' ) );
|
||||
$countries = WC()->countries->get_allowed_countries();
|
||||
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', 1 === count( $countries ) ? key( $countries ) : '' ) );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue