|
@@ 846-857 (lines=12) @@
|
| 843 |
|
$billing_state = ! empty( $_POST['billing_state'] ) ? wc_clean( $_POST['billing_state'] ) : ''; |
| 844 |
|
$shipping_state = ! empty( $_POST['shipping_state'] ) ? wc_clean( $_POST['shipping_state'] ) : ''; |
| 845 |
|
|
| 846 |
|
if ( $billing_state && $billing_country ) { |
| 847 |
|
$valid_states = WC()->countries->get_states( $billing_country ); |
| 848 |
|
|
| 849 |
|
// Valid states found for country. |
| 850 |
|
if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) { |
| 851 |
|
foreach ( $valid_states as $state_abbr => $state ) { |
| 852 |
|
if ( preg_match( '/' . preg_quote( $state ) . '/i', $billing_state ) ) { |
| 853 |
|
$_POST['billing_state'] = $state_abbr; |
| 854 |
|
} |
| 855 |
|
} |
| 856 |
|
} |
| 857 |
|
} |
| 858 |
|
|
| 859 |
|
if ( $shipping_state && $shipping_country ) { |
| 860 |
|
$valid_states = WC()->countries->get_states( $shipping_country ); |
|
@@ 859-870 (lines=12) @@
|
| 856 |
|
} |
| 857 |
|
} |
| 858 |
|
|
| 859 |
|
if ( $shipping_state && $shipping_country ) { |
| 860 |
|
$valid_states = WC()->countries->get_states( $shipping_country ); |
| 861 |
|
|
| 862 |
|
// Valid states found for country. |
| 863 |
|
if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) { |
| 864 |
|
foreach ( $valid_states as $state_abbr => $state ) { |
| 865 |
|
if ( preg_match( '/' . preg_quote( $state ) . '/i', $shipping_state ) ) { |
| 866 |
|
$_POST['shipping_state'] = $state_abbr; |
| 867 |
|
} |
| 868 |
|
} |
| 869 |
|
} |
| 870 |
|
} |
| 871 |
|
} |
| 872 |
|
|
| 873 |
|
/** |