• Resolved sysliu

    (@sysliu)


    Hi,

    I need some help with the “shipping_state” field. For some reasons, when I download the order details, only this “shipping_state” is in English and every other field is in local language (Traditional Chinese) which is what we wanted. Is there anything that the plug-in or I can set up to force the output to be in local language?

    Thanks!

    -Sean

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello Sean

    Do you see states as CNxx ?

    Could you try field “State Name (Shipping)” ( section >Setup Fields>Shipping)

    thanks, Alex

    Thread Starter sysliu

    (@sysliu)

    Hi Alex,

    Thank you very much for your help. State Name (Shipping) works when I try to download the field. Thanks. However, my ultimate goal is to create a field which has the full address:

    I original have this and it works, but as I mentioned “shipping_state” is in English.

    $value = $order->get_shipping_postcode() . ” .$order->get_shipping_state(). ” .$order->get_shipping_city()
    . ” .$order->get_shipping_address_1();
    return $value;
    },10,3);

    May I check what is the right meta_key for State Name (Shipping)? I tried to use $order->get_shipping_state_full() and it didn’t work.

    Again thanks for your help.

    -Sean

    Plugin Author algol.plus

    (@algolplus)

    please, use this way to get full name for state

    $country_states = WC()->countries->get_states( $order->get_shipping_country() );
    $state_name_full = $country_states[ $order->get_shipping_state() ];
    Thread Starter sysliu

    (@sysliu)

    Hi Alex,

    It works! Many thanks for your help!

    -Sean

    Plugin Author algol.plus

    (@algolplus)

    You’re very welcome.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘shipping_state is in English instead of local language’ is closed to new replies.