On this page
Country settings
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
Ubercart uses a simple interface for importing and updating information for international country support. Browse to the country settings page at Administration » Store » Configuration » Countries and addresses (/admin/store/settings/countries). This page has three tabs - the one you are on, labelled "Countries", will show you a list of countries currently installed (U.S. and Canada by default) along with a select box that lets you import additional countries. The second tab, labelled "Address fields", allows you to specify they type of address information you want to collect from your customers. The third tab, "Address formats", allows you to customize how addresses are formatted for each of the countries you have installed. Read on to learn how to get additional country support for your installation.
Imported countries
The table in this section lists the countries you have installed, their current versions, and a set of operations for each one. "Installed" means that the country will be one of the selections your customers may choose from when specifying a billing or a shipping address. From this list you can disable/enable, update, and remove countries you have installed. A disabled country can simply no longer be selected on address forms whereas a removed country is totally wiped from the database. In the case of a store that has been accepting orders from other countries and no longer wishes to support them, it is recommended that you simply disable the country instead of removing it. Addresses for countries that are removed will no longer display properly if the country is removed, even if it is later imported again.
To import a new country or update to a new version of a country file, you must place the most recent file in the Ubercart directory ubercart/uc_store/countries on your server. The latest version of the file will always be used for importing and updating. To install a new country, simply select it with the select box and click the Import button!
Note that you should not just blindly install all the available countries - it is highly unlikely that you can sell to or ship to every single one of those countries. The countries you install should be carefully considered.
Country specific settings
The first collapsed box is the key for writing address formats. When a country is imported, its default address format is set. However, if you need to change the way it displays you may do so using the instructions for address formats and the country's settings menu. Simply click the name of the country you want to modify and put in the address format you want to use. Instead of typing out an actual address, use the following variables to represent the different components of an address.
| Variable | Description |
|---|---|
| !first_name | Customer's first name |
| !last_name | Customer's last name |
| !company | Company name |
| !street1 | First street address field |
| !street2 | Second street address field |
| !city | City name |
| !zone_name | Full name of the zone |
| !zone_code | Abbreviation of the zone |
| !postal_code | Postal code |
| !country_name | Name of the country |
| !country_code2 | 2 digit country abbreviation |
| !country_code3 | 3 digit country abbreviation |
| !country_name_if | name of the country, if different from store country |
| !country_code2_if | 2 digit country abbreviation, if different from store country |
| !country_code3_if | 3 digit country abbreviation, if different from store country |
The following example is the default address format for addresses in the U.S.
!company<br />!first_name !last_name<br />!street1<br />!street2<br />!city, !zone_code !postal_code<br />!country_name_if
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion