Fixed an exception that was thrown when a country had no states when checking for package shippability
This commit is contained in:
parent
027257f624
commit
a7daebc6fd
|
@ -293,8 +293,8 @@ class WC_Shipping {
|
|||
return false;
|
||||
}
|
||||
|
||||
$states = array_keys( WC()->countries->get_states( $country ) );
|
||||
if ( is_array( $states ) && ! in_array( $package['destination']['state'], $states, true ) ) {
|
||||
$states = WC()->countries->get_states( $country );
|
||||
if ( is_array( $states ) && ! isset( $states[ $package['destination']['state'] ] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue