Created
September 7, 2022 16:08
-
-
Save zakirsajib/fd7783bfb451d9a493a3ae7e17e58626 to your computer and use it in GitHub Desktop.
Change the default country on the checkout page: Woocommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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