Answer the question
In order to leave comments, you need to log in
How to get location output in Cyrillic (ru) and Latin (en) in Bitrix?
Hello!
Dear experts, tell me how can I get the output of locations from the location module 2.0 in Russian and in en, with transcription as indicated in locations (en)? Through the output agent the complete nonsense turns out.
Answer the question
In order to leave comments, you need to log in
If you have not yet exhausted the limit of free requests or paid for a paid package to a geo data provider from those that are in Bitrix out of the box (below we use the free part of Sypex), then the request:
use \Bitrix\Main\Service\GeoIp;
$result = GeoIp\Manager::getDataResult('178.219.187.10', 'en');
if ($result->isSuccess()) {
$obGeoData = $result->getGeoData();
print_r($obGeoData);
}
[ip] => 178.219.187.10
[lang] => en
[countryName] => Russia
[regionName] => Moskva
[subRegionName] =>
[cityName] => Moscow
[countryCode] => RU
[regionCode] => RU-MOW
[zipCode] =>
[latitude] => 55.75222
[longitude] => 37.61556
[timezone] => Europe/Moscow
[asn] =>
[ispName] =>
[organizationName] =>
[handlerClass] => Bitrix\Main\Service\GeoIp\SypexGeo
[ip] => 178.219.187.10
[lang] => ru
[countryName] => Россия
[regionName] => Москва
[subRegionName] =>
[cityName] => Москва
[countryCode] => RU
[regionCode] => RU-MOW
[zipCode] =>
[latitude] => 55.75222
[longitude] => 37.61556
[timezone] => Europe/Moscow
[asn] =>
[ispName] =>
[organizationName] =>
[handlerClass] => Bitrix\Main\Service\GeoIp\SypexGeo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question