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.
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.
1 2 3 4 5 6 7 8 9 10 | 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.
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.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: woocommerce hide additional information tab, woocommerce tutorial, woocommerce tutorials, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials for beginners, wordpress woocommerce tutorial