Sets Select a country option value as default on shipping-calculator country select input.

This commit is contained in:
Jeffrey Scott French 2020-05-18 13:48:21 -04:00
parent eea062f9fa
commit a75c118c02
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ do_action( 'woocommerce_before_shipping_calculator' ); ?>
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_country', true ) ) : ?> <?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_country', true ) ) : ?>
<p class="form-row form-row-wide" id="calc_shipping_country_field"> <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"> <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 / region&hellip;', 'woocommerce' ); ?></option> <option value="default"><?php esc_html_e( 'Select a country / region&hellip;', 'woocommerce' ); ?></option>
<?php <?php
foreach ( WC()->countries->get_shipping_countries() as $key => $value ) { 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>'; echo '<option value="' . esc_attr( $key ) . '"' . selected( WC()->customer->get_shipping_country(), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';