Merge pull request #25530 from woocommerce/fix/country-region-label
Fix/country region label
This commit is contained in:
commit
4a506ebcf7
|
@ -71,11 +71,11 @@ if ( ! class_exists( 'WC_Admin_Profile', false ) ) :
|
|||
'description' => '',
|
||||
),
|
||||
'billing_country' => array(
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'label' => __( 'Country / Region', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'class' => 'js_field-country',
|
||||
'type' => 'select',
|
||||
'options' => array( '' => __( 'Select a country…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
),
|
||||
'billing_state' => array(
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
|
@ -131,11 +131,11 @@ if ( ! class_exists( 'WC_Admin_Profile', false ) ) :
|
|||
'description' => '',
|
||||
),
|
||||
'shipping_country' => array(
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'label' => __( 'Country / Region', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'class' => 'js_field-country',
|
||||
'type' => 'select',
|
||||
'options' => array( '' => __( 'Select a country…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
),
|
||||
'shipping_state' => array(
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
|
|
|
@ -141,7 +141,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
|||
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ),
|
||||
'i18n_moved_up' => __( 'Item moved up', 'woocommerce' ),
|
||||
'i18n_moved_down' => __( 'Item moved down', 'woocommerce' ),
|
||||
'i18n_no_specific_countries_selected' => __( 'Selecting no country to sell to prevents from completing the checkout. Continue anyway?', 'woocommerce' ),
|
||||
'i18n_no_specific_countries_selected' => __( 'Selecting no country / region to sell to prevents from completing the checkout. Continue anyway?', 'woocommerce' ),
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -594,7 +594,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
|||
<th scope="row" class="titledesc">
|
||||
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?> <?php echo $tooltip_html; // WPCS: XSS ok. ?></label>
|
||||
</th>
|
||||
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php esc_attr_e( 'Choose a country…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'woocommerce' ); ?>" class="wc-enhanced-select">
|
||||
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php esc_attr_e( 'Choose a country / region…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country / Region', 'woocommerce' ); ?>" class="wc-enhanced-select">
|
||||
<?php WC()->countries->country_dropdown_options( $country, $state ); ?>
|
||||
</select> <?php echo $description; // WPCS: XSS ok. ?>
|
||||
</td>
|
||||
|
@ -619,7 +619,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
|||
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?> <?php echo $tooltip_html; // WPCS: XSS ok. ?></label>
|
||||
</th>
|
||||
<td class="forminp">
|
||||
<select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:350px" data-placeholder="<?php esc_attr_e( 'Choose countries…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'woocommerce' ); ?>" class="wc-enhanced-select">
|
||||
<select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:350px" data-placeholder="<?php esc_attr_e( 'Choose countries / regions…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country / Region', 'woocommerce' ); ?>" class="wc-enhanced-select">
|
||||
<?php
|
||||
if ( ! empty( $countries ) ) {
|
||||
foreach ( $countries as $key => $val ) {
|
||||
|
|
|
@ -557,7 +557,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<div class="store-address-container">
|
||||
|
||||
<label for="store_country" class="location-prompt"><?php esc_html_e( 'Where is your store based?', 'woocommerce' ); ?></label>
|
||||
<select id="store_country" name="store_country" required data-placeholder="<?php esc_attr_e( 'Choose a country…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'woocommerce' ); ?>" class="location-input wc-enhanced-select dropdown">
|
||||
<select id="store_country" name="store_country" required data-placeholder="<?php esc_attr_e( 'Choose a country / region…', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country / Region', 'woocommerce' ); ?>" class="location-input wc-enhanced-select dropdown">
|
||||
<?php foreach ( WC()->countries->get_countries() as $code => $label ) : ?>
|
||||
<option <?php selected( $code, $country ); ?> value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $label ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -70,11 +70,11 @@ class WC_Meta_Box_Order_Data {
|
|||
'show' => false,
|
||||
),
|
||||
'country' => array(
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'label' => __( 'Country / Region', 'woocommerce' ),
|
||||
'show' => false,
|
||||
'class' => 'js_field-country select short',
|
||||
'type' => 'select',
|
||||
'options' => array( '' => __( 'Select a country…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
|
||||
),
|
||||
'state' => array(
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
|
@ -122,11 +122,11 @@ class WC_Meta_Box_Order_Data {
|
|||
'show' => false,
|
||||
),
|
||||
'country' => array(
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'label' => __( 'Country / Region', 'woocommerce' ),
|
||||
'show' => false,
|
||||
'type' => 'select',
|
||||
'class' => 'js_field-country select short',
|
||||
'options' => array( '' => __( 'Select a country…', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(),
|
||||
'options' => array( '' => __( 'Select a country / region…', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(),
|
||||
),
|
||||
'state' => array(
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
|
|
|
@ -661,7 +661,7 @@ class WC_Countries {
|
|||
),
|
||||
'country' => array(
|
||||
'type' => 'country',
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'label' => __( 'Country / Region', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
|
||||
'autocomplete' => 'country',
|
||||
|
|
|
@ -51,7 +51,7 @@ class WC_Privacy_Erasers {
|
|||
'billing_city' => __( 'Billing City', 'woocommerce' ),
|
||||
'billing_postcode' => __( 'Billing Postal/Zip Code', 'woocommerce' ),
|
||||
'billing_state' => __( 'Billing State', 'woocommerce' ),
|
||||
'billing_country' => __( 'Billing Country', 'woocommerce' ),
|
||||
'billing_country' => __( 'Billing Country / Region', 'woocommerce' ),
|
||||
'billing_phone' => __( 'Phone Number', 'woocommerce' ),
|
||||
'billing_email' => __( 'Email Address', 'woocommerce' ),
|
||||
'shipping_first_name' => __( 'Shipping First Name', 'woocommerce' ),
|
||||
|
@ -62,7 +62,7 @@ class WC_Privacy_Erasers {
|
|||
'shipping_city' => __( 'Shipping City', 'woocommerce' ),
|
||||
'shipping_postcode' => __( 'Shipping Postal/Zip Code', 'woocommerce' ),
|
||||
'shipping_state' => __( 'Shipping State', 'woocommerce' ),
|
||||
'shipping_country' => __( 'Shipping Country', 'woocommerce' ),
|
||||
'shipping_country' => __( 'Shipping Country / Region', 'woocommerce' ),
|
||||
),
|
||||
$customer
|
||||
);
|
||||
|
|
|
@ -186,7 +186,7 @@ class WC_Privacy_Exporters {
|
|||
'billing_city' => __( 'Billing City', 'woocommerce' ),
|
||||
'billing_postcode' => __( 'Billing Postal/Zip Code', 'woocommerce' ),
|
||||
'billing_state' => __( 'Billing State', 'woocommerce' ),
|
||||
'billing_country' => __( 'Billing Country', 'woocommerce' ),
|
||||
'billing_country' => __( 'Billing Country / Region', 'woocommerce' ),
|
||||
'billing_phone' => __( 'Phone Number', 'woocommerce' ),
|
||||
'billing_email' => __( 'Email Address', 'woocommerce' ),
|
||||
'shipping_first_name' => __( 'Shipping First Name', 'woocommerce' ),
|
||||
|
@ -197,7 +197,7 @@ class WC_Privacy_Exporters {
|
|||
'shipping_city' => __( 'Shipping City', 'woocommerce' ),
|
||||
'shipping_postcode' => __( 'Shipping Postal/Zip Code', 'woocommerce' ),
|
||||
'shipping_state' => __( 'Shipping State', 'woocommerce' ),
|
||||
'shipping_country' => __( 'Shipping Country', 'woocommerce' ),
|
||||
'shipping_country' => __( 'Shipping Country / Region', 'woocommerce' ),
|
||||
),
|
||||
$customer
|
||||
);
|
||||
|
|
|
@ -2698,7 +2698,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
|
||||
} else {
|
||||
|
||||
$field = '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . '><option value="">' . esc_html__( 'Select a country…', 'woocommerce' ) . '</option>';
|
||||
$field = '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . '><option value="">' . esc_html__( 'Select a country / region…', 'woocommerce' ) . '</option>';
|
||||
|
||||
foreach ( $countries as $ckey => $cvalue ) {
|
||||
$field .= '<option value="' . esc_attr( $ckey ) . '" ' . selected( $value, $ckey, false ) . '>' . $cvalue . '</option>';
|
||||
|
@ -2706,7 +2706,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
|
||||
$field .= '</select>';
|
||||
|
||||
$field .= '<noscript><button type="submit" name="woocommerce_checkout_update_totals" value="' . esc_attr__( 'Update country', 'woocommerce' ) . '">' . esc_html__( 'Update country', 'woocommerce' ) . '</button></noscript>';
|
||||
$field .= '<noscript><button type="submit" name="woocommerce_checkout_update_totals" value="' . esc_attr__( 'Update country / region', 'woocommerce' ) . '">' . esc_html__( 'Update country / region', 'woocommerce' ) . '</button></noscript>';
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ do_action( 'woocommerce_before_shipping_calculator' ); ?>
|
|||
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_country', true ) ) : ?>
|
||||
<p class="form-row form-row-wide" id="calc_shipping_country_field">
|
||||
<select name="calc_shipping_country" id="calc_shipping_country" class="country_to_state country_select" rel="calc_shipping_state">
|
||||
<option value=""><?php esc_html_e( 'Select a country…', 'woocommerce' ); ?></option>
|
||||
<option value=""><?php esc_html_e( 'Select a country / region…', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
foreach ( WC()->countries->get_shipping_countries() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '"' . selected( WC()->customer->get_shipping_country(), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
*
|
||||
* @package WooCommerce\Tests\Util
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tests for WC_Privacy_Exporters class.
|
||||
*/
|
||||
class WC_Test_Privacy_Export extends WC_Unit_Test_Case {
|
||||
|
||||
/**
|
||||
|
@ -92,7 +96,7 @@ class WC_Test_Privacy_Export extends WC_Unit_Test_Case {
|
|||
'value' => 'PA',
|
||||
),
|
||||
array(
|
||||
'name' => 'Billing Country',
|
||||
'name' => 'Billing Country / Region',
|
||||
'value' => 'US',
|
||||
),
|
||||
array(
|
||||
|
@ -120,7 +124,7 @@ class WC_Test_Privacy_Export extends WC_Unit_Test_Case {
|
|||
'value' => 'PA',
|
||||
),
|
||||
array(
|
||||
'name' => 'Shipping Country',
|
||||
'name' => 'Shipping Country / Region',
|
||||
'value' => 'US',
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue