• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/phonenumber/parser.php
  • Класс: BitrixMainPhoneNumberParser
  • Вызов: Parser::getDefaultCountry
static function getDefaultCountry()
{
	$defaultCountryId = Option::get('main', static::DEFAULT_COUNTRY_OPTION);

	if(!$defaultCountryId)
	{
		$detectedCountry = static::detectCountry();
		$detectedCountryId = GetCountryIdByCode($detectedCountry);
		if($detectedCountryId > 0)
		{
			Option::set('main', static::DEFAULT_COUNTRY_OPTION, $detectedCountryId);
			$defaultCountryId = $detectedCountryId;
		}
	}

	return $defaultCountryId ? GetCountryCodeById($defaultCountryId) : "";
}