M
M
makboriska2022-01-08 00:28:25
WordPress
makboriska, 2022-01-08 00:28:25

How to display full billing country in Woocommerce?

I need to display the country of the client in the header of the site (it is selected in the personal account), in fact it is billing_country.
I am trying to display the name of the country with the following code

WC()->customer->get_billing_country();
. not Russia but Ru, not Afghanistan but AF, but you need to display the full name of the country, how to do it?

Tried like this

WC()->countries->states[$order->billing_country]
but it doesn't work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2022-01-08
@makboriska

WC()->countries->states[WC()->customer->get_billing_country()]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question