Countries

You can use this to output country names and codes in Alpha3 (by default) or Alpha2 format.

To edit the list of countries that are used, see Locales Config.

Table of Contents

Parameters

alpha2

Sets the output of the country_code to use Alpha2, e.g. (US, GB, CA, DE).

alpha2="yes"

Variables

country_code

The 3-letter country code.

{country_code}
USA

country

The name of the country.

{country}
United States of America

Examples

<select name="country_code">
{exp:cartthrob:countries}
<option value="{country_code}">{country}</option>
{/exp:cartthrob:countries}
</select>