Merge branch 'pr/10085'

This commit is contained in:
Mike Jolley 2016-01-18 10:25:06 +00:00
commit 424bc62e74
1 changed files with 9 additions and 0 deletions

View File

@ -286,6 +286,7 @@ class WC_Admin_Setup_Wizard {
$currency = get_option( 'woocommerce_currency', 'GBP' );
$currency_pos = get_option( 'woocommerce_currency_pos', 'left' );
$decimal_sep = get_option( 'woocommerce_price_decimal_sep', '.' );
$num_decimals = get_option( 'woocommerce_price_num_decimals', '2' );
$thousand_sep = get_option( 'woocommerce_price_thousand_sep', ',' );
$dimension_unit = get_option( 'woocommerce_dimension_unit', 'cm' );
$weight_unit = get_option( 'woocommerce_weight_unit', 'kg' );
@ -338,6 +339,12 @@ class WC_Admin_Setup_Wizard {
<input type="text" id="decimal_sep" name="decimal_sep" size="2" value="<?php echo esc_attr( $decimal_sep ) ; ?>" />
</td>
</tr>
<tr>
<th scope="row"><label for="num_decimals"><?php _e( 'Number of Decimals', 'woocommerce' ); ?></label></th>
<td>
<input type="text" id="num_decimals" name="num_decimals" size="2" value="<?php echo esc_attr( $num_decimals ) ; ?>" />
</td>
</tr>
<tr>
<th scope="row"><label for="weight_unit"><?php _e( 'Which unit should be used for product weights?', 'woocommerce' ); ?></label></th>
<td>
@ -381,6 +388,7 @@ class WC_Admin_Setup_Wizard {
$currency_code = sanitize_text_field( $_POST['currency_code'] );
$currency_pos = sanitize_text_field( $_POST['currency_pos'] );
$decimal_sep = sanitize_text_field( $_POST['decimal_sep'] );
$num_decimals = sanitize_text_field( $_POST['num_decimals'] );
$thousand_sep = sanitize_text_field( $_POST['thousand_sep'] );
$weight_unit = sanitize_text_field( $_POST['weight_unit'] );
$dimension_unit = sanitize_text_field( $_POST['dimension_unit'] );
@ -389,6 +397,7 @@ class WC_Admin_Setup_Wizard {
update_option( 'woocommerce_currency', $currency_code );
update_option( 'woocommerce_currency_pos', $currency_pos );
update_option( 'woocommerce_price_decimal_sep', $decimal_sep );
update_option( 'woocommerce_price_num_decimals', $num_decimals );
update_option( 'woocommerce_price_thousand_sep', $thousand_sep );
update_option( 'woocommerce_weight_unit', $weight_unit );
update_option( 'woocommerce_dimension_unit', $dimension_unit );