Skip to content

Instantly share code, notes, and snippets.

@zakirsajib
Created September 7, 2022 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakirsajib/fd7783bfb451d9a493a3ae7e17e58626 to your computer and use it in GitHub Desktop.
Save zakirsajib/fd7783bfb451d9a493a3ae7e17e58626 to your computer and use it in GitHub Desktop.
Change the default country on the checkout page: Woocommerce
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' );
function change_default_checkout_country() {
if ( WC()->customer->get_is_paying_customer() ) {
return $country;
}
return 'US';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment