I wonder how to get list of country code [not country names] in WooCommerce?
I've gone through the WooCommerce docs but can't find the code. I know how to get the list of country names from WooCommerce but can't figure out how to get the codes
I am putting a country select box on a custom registration template. Where the select option value should be country code.
Example
$all_countries = $countries_obj->countries; //Country Name array
$all_countries_code = ?????
foreach($all_countries as $ac){
echo '<option selected value="[country_code]">'.$ac.'</option>';
}
Any help would be appreciated to get the country code array.