billing_state problem

RandomGirl

New Member
Hello there,
When ordering on aliexpress from alidswoo, the state of non US countries isn't filled correctly. The state code is used instead of the state NAME which makes us search the state name on Google each time.
Any idea on how to fix this?
Thanks.

PS: the states have been added manually like this in functions.php:

add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['XX'] = array(
"01" => "XY",
"02" => "YZ",
[...]
return $states;

I guess this is because on the Aliexpress order page, when sending to US, the state is a dropdown field with prefilled states. But for other countries, the field is just a normal text field, not a dropdown list. We need alidswoo to place the state name here and not the code (wich is taken from "billing_state" in woocommerce).
 
Last edited:

Victoria Kudryashova

Administrator
Hello there,
When ordering on aliexpress from alidswoo, the state of non US countries isn't filled correctly. The state code is used instead of the state NAME which makes us search the state name on Google each time.
Any idea on how to fix this?
Thanks.

PS: the states have been added manually like this in functions.php:

add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['XX'] = array(
"01" => "XY",
"02" => "YZ",
[...]
return $states;

I guess this is because on the Aliexpress order page, when sending to US, the state is a dropdown field with prefilled states. But for other countries, the field is just a normal text field, not a dropdown list. We need alidswoo to place the state name here and not the code (wich is taken from "billing_state" in woocommerce).
Hello, could you please give us a list of such countries - we will add them in database to make it work like you want.
 

RandomGirl

New Member
Hello Victoria! That's great to hear. Sure, I will PM you the list as it's pretty long and I already found the state code => name pair.
Thank you again.
 
Top