Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Change The Default State And Country on The Checkout

How to change the default state and country on the checkout

If you want to set the Default shipping Country and shipping state on the checkout page in your WooCommerce store, then keep your close attention in this tutorial as I am going share how to change the default state and country on the checkout page.

How to change the default state and country on the checkout

Copy the below code and add at the end of functions.php file to set the default country and state on the checkout page. In the below code I have set the USA as a country and New Jersy as a state.

add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
add_filter( 'default_checkout_billing_state', 'change_default_checkout_state' );

function change_default_checkout_country() {
  return 'US'; // country code
}

function change_default_checkout_state() {
  return 'NJ'; // state code
}

After adding the above code.

How to change the default state and country on the checkout

I hope this tutorial helps you, if you have any questions regarding WordPress, then feel free to put your comments in below comment section. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

The post How to Change The Default State And Country on The Checkout appeared first on FreeWebMentor.



This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here

Share the post

How to Change The Default State And Country on The Checkout

×

Subscribe to Programming Blog Focused On Web Technologies

Get updates delivered right to your inbox!

Thank you for your subscription

×