if (Bitrix\Main\Loader::includeModule('twofingers.location'))
$location = \TwoFingers\Location\Entity\Location::buildCurrent();
$smp = $location->getPrimary();
$arElm = CSaleLocation::GetList(array(), array('CODE' => $smp), false, false, array('ID'))->Fetch();
if ($arElm)
$resultmp = (int) $arElm['ID'];
echo $resultmp;
function getLocationByCode(string $locationCode){
return \CSaleLocation::getLocationIDbyCODE($locationCode);
}