Last active
March 2, 2018 06:15
-
-
Save manojmohangit/29f319557712cf6f09dfd228cb10b52e to your computer and use it in GitHub Desktop.
Set the default country on the checkout in Woocommerce 3.0+
This file contains hidden or 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($county_code) { | |
return empty($county_code) ? 'XX' : $county_code ; // 'XX' is the default country code if there is no country code passed on to the filter (if user has saved billing country). | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment