• Resolved ts_hamlet

    (@ts_hamlet)


    When i’m getting the information from a WC_Order object in a plugin, i’m finding the “state” value is an abbreviation / code for the region entered in the checkout:

    $order = wc_get_order( $orderId );
    $shippingState = $order->get_shipping_state() //returns eg “HT” for Hertfordshire, “BK” for Berkshire etc.

    What i am looking for is the full (UK) string of the shipping state, but see it isn’t stored anywhere in the object?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @ts_hamlet,

    It sounds like you may end up needing to write a function that matches the abbreviations and returns a string with the full state name.

    Hi @ts_hamlet,

    We have not heard back from you in a while, so I am going to go ahead and close this thread. If you are still experiencing the issue please reply to this thread. Otherwise open a new thread and let us know.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce Wc_Order shipping state – full string needed, two letters returned’ is closed to new replies.