Use measurement unit defaults in locale-info instead of hard coding

This commit is contained in:
Paul Dechov 2017-10-26 09:28:18 -04:00
parent fee6f954dc
commit d048e4d355
1 changed files with 4 additions and 3 deletions

View File

@ -715,9 +715,10 @@ class WC_Admin_Setup_Wizard {
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
$existing_zones = WC_Shipping_Zones::get_zones();
if ( 'US' === $country_code ) {
$dimension_unit = 'in';
$weight_unit = 'oz';
$locale_info = include( WC()->plugin_path() . '/i18n/locale-info.php' );
if ( isset( $locale_info[ $country_code ] ) ) {
$dimension_unit = $locale_info[ $country_code ]['dimension_unit'];
$weight_unit = $locale_info[ $country_code ]['weight_unit'];
} else {
$dimension_unit = 'cm';
$weight_unit = 'kg';