Bitrix Site Manager

CSaleLocation::GetCountryList

CDBResult
CSaleLocation::GetCountryList(
  array arOrder = Array("NAME_LANG"=>"ASC"),
  array arFilter = Array(),
  string strLang = LANGUAGE_ID
);

The method GetCountryList returns a filtered and sorted list of countries. Language-dependent parameters are returned for the language specified in the second parameter.

Parameters

ParameterDescription
arOrder Assosiated array defining the record sorting. Sorting is performed consequently on each pair "key - value". Keys are the parameter names. Values are sort direction constants.

The following keys are possible:
  • NAME_LANG - language dependent country name;
  • ID - the country ID;
  • NAME - language independent country name;
  • SHORT_NAME - language independent country name abbreviation.
Possible values:
  • ASC - ascending;
  • DESC - descending
arFilter Assosiated array used to filter records. Only the records which satisfy the filter are included in the returned list. Keys are the parameter names, and the values are conditions.

The following keys are possible:
  • ID - the country ID;
  • NAME - language independent country name
strLang The ID of the language in which the language-dependent parameters will be returned. By default, the current language is used.

Return Values

Returns a CDBResult instance containing a set of associated arrays with the following keys.

Key Description
ID The country ID.
NAME_ORIG Language-independent country name
SHORT_NAME Short language-independent name of the country
NAME Language dependent country name
NAME_LANG Language dependent country name if it exists. Otherwise, language-independent name of the country.