How to customise the address format in WooCommerce
Each country has a different address format, for example, U.S. uses the abbreviated state name, while Australia usually shows the full state name.
These are not rules set in stone though and they can always be changed. How
Open your functions.php file in wp-content/themes/your-child-theme-name/ and add this code at the end of the file:
This code changes the address format for the United States, using the full state name instead of the state code so that an address like:
Nicola Mustone
937 South Green St.
Fresno, CA 93722
will become:
Nicola Mustone
937 South Green St.
Fresno, California 93722
Address format options
In the code, you can see some placeholders
{name}
{state}
, but there are many of these that you can use in your custom format.
Here is a complete list:
{first_name}
{last_name}
{name}
{company}
{address_1}
{address_2}
{city}
{state}
{postcode}
{country}
{first_name_upper}
{last_name_upper}
{name_upper}
{company_upper}
{address_1_upper}
{address_2_upper}
{city_upper}
{state_upper}
{state_code}
{postcode_upper}
{country_upper}
working good i need to check how to setup that in woocommerce so i can finish it
Thanks for your useful post. Do you have any plugin recommendations? I just want to customize the address format with some simple clicks, instead of entering this code. 🙂