Countries in your store can be managed using the 'Countries Management' section of the Admin area (In X-Cart versions 4.4.0 and later, this section can be found at Shipping and Taxes menu -> Countries; in X-Cart versions 4.3.0-4.3.2, this section can be found at Settings menu -> Countries; in earlier versions, this section can be found at Management menu -> Countries). This section contains a dialog box titled 'Countries' which provides a table of country names and allows you to adjust attributes of individual countries: country codes, absence/presence of states and active/inactive status.
The links provided at the top of the 'Countries' dialog box (All regions, North America, Europe, etc) allow you to view and manage sets of countries located in the named regions.
Table columns provide the following information:
- COUNTRY - Country names.
- ACTIVE - Check boxes whose status defines whether a country is included into 'Country' drop-down menus or not (Only countries whose 'active' check box is selected are included). By default, all the countries in the table are active. If you need to limit the number of countries from which profile registrations will be welcome, deactivate all the countries that you do not want to be included.
The set of countries that can be used in an X-Cart based store is rigidly defined in the system, so you cannot add new countries to the list or delete existing ones. What you can do is edit country names, activate/deactivate specific countries and change their 'has states' statuses.
If you do not wish some of the countries to appear in 'Country' drop-down boxes on user registration/user profile forms, simply deactivate the countries that you wish to be excluded.
If a country you need is not on the list of available countries, request assistance from X-Cart technical support team.
To edit a country name, find the name in the table, replace it with a new one and click the Update button.
To change a country's 'has states' status, adjust the check box opposite its name in the HAS STATES column and click the Update button.
To activate/deactivate a country, select/unselect the check box opposite its name in the ACTIVE column and click the Update button. You can use the Check all / Uncheck all links located above the 'Countries' table to select or unselect all the 'active' check boxes on the current page. You can also activate/deactivate all the countries in the table regardless of the country set selected with a single click: by using the buttons Activate All and Deactivate All.
Multilingual country names
It is possible to have different names for your active countries that will be used depending on the language selected for the interface. Names for countries can be created using the 'Edit languages' section of your store (In X-Cart versions 4.4.0 and later, this section can be found at Content menu -> Languages; in earlier versions, this section can be found at Administration menu -> Languages).
To add country names in a language that does not yet have its own names for countries:
- Go to the 'Edit languages' section.
- Select the necessary language for editing. Make sure the charset specified in the 'Edit language' form is correct. If not, enter the necessary charset code and click the Change button.
- Use the language selector to switch the current language of the Admin area to the target language.
- Enable your computer to type in the selected language.
- Select the topic 'Countries' in the language variables filter.
- Use the 'Edit language entries' dialog box to translate the necessary country language variables into the selected language and apply the changes by clicking the Update all button.
How to add a new country?
To add a country, you need to add an entry to xcart_countries table, and one more entry to xcart_lanuguages table.
For example, for Republic of Serbia you need to use the following SQL queries:
INSERT INTO `xcart_countries` (`code`, `code_A3`, `code_N3`, `region`, `active`, `display_states`) VALUES ('RS','SRB','688','EU','Y','Y'); INSERT INTO `xcart_languages` (`code`, `name`, `value`, `topic`) VALUES (`en`,`country_RS`,`Serbia`,`Countries`);
Here is the structure and possible field values for table xcart_countries
- code: two-letter country code, ISO 3166-1 alpha-2
- code_A3: three-letter country code, ISO 3166-1 alpha-3
- code_N3: three-digit country code, ISO 3166-1 numeric-3
- region: two-letter region code
- active: Y or N
- display_states: Y or N
Region codes (possible values):
- NA - North America
- EU - Europa
- AU - Australia and Oceania
- LA - Latin America
- AS - Asia
- AF - Africa
- AN - Antarctica
The last two capital letters of `country_RS` represent the two-letter country code for Republic of Serbia.