Ignore existing unit option values in wizard, in favor of national conventions

This commit is contained in:
Paul Dechov 2017-10-19 18:44:36 -04:00
parent 787bb7f0c0
commit fee6f954dc
1 changed files with 6 additions and 10 deletions

View File

@ -708,8 +708,6 @@ class WC_Admin_Setup_Wizard {
* Shipping.
*/
public function wc_setup_shipping() {
$dimension_unit = get_option( 'woocommerce_dimension_unit', false );
$weight_unit = get_option( 'woocommerce_weight_unit', false );
$country_code = WC()->countries->get_base_country();
$country_name = WC()->countries->countries[ $country_code ];
$prefixed_country_name = WC()->countries->estimated_for_prefix( $country_code ) . $country_name;
@ -717,14 +715,12 @@ class WC_Admin_Setup_Wizard {
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
$existing_zones = WC_Shipping_Zones::get_zones();
if ( false === $dimension_unit || false === $weight_unit ) {
if ( 'US' === $country_code ) {
$dimension_unit = 'in';
$weight_unit = 'oz';
} else {
$dimension_unit = 'cm';
$weight_unit = 'kg';
}
if ( 'US' === $country_code ) {
$dimension_unit = 'in';
$weight_unit = 'oz';
} else {
$dimension_unit = 'cm';
$weight_unit = 'kg';
}
if ( ! empty( $existing_zones ) ) {