View Country Name
view_country_name converts a 3-letter (Alpha-3) country code to the full country name.
This tag performs a direct Alpha-3 lookup. If you need Alpha-2 support (US, CA, etc.), use convert_country_code instead.
See also:
Parameters
country_code
Three-letter country code used to look up and output the full country name.
Expected format: Alpha-3 (for example USA, CAN, GBR).
country_code="USA"
Behavior and Constraints
- This is an immediate-execution single tag.
- Lookup uses CartThrob locales country list (
all_countries()), keyed by Alpha-3 code. - If
country_codeis not an exact Alpha-3 match, output is empty. - Missing
country_codealso returns empty output.
Examples
Basic usage:
{exp:cartthrob:view_country_name country_code="USA"}
With customer info:
{exp:cartthrob:customer_info}
{exp:cartthrob:view_country_name country_code="{customer_country_code}"}
{/exp:cartthrob:customer_info}