D
D
Darklt2018-05-22 12:53:46
1C-Bitrix
Darklt, 2018-05-22 12:53:46

How to bind a city session to a component in Bitrix?

There is a geolocation module with auto-detection of the city, there is a second component that takes information from the infoblock data with cities, how to insert it so that it substitutes the city session, and if the city is not found or this city does not exist, then substitute another:
Session with the city:
$_SESSION["USER_GEO_POSITION"]["city"]
Component output from the infoblock:

CModule::IncludeModule('iblock');
$arSelect = Array(
    "ID",
    "IBLOCK_ID",
    "NAME",
    "DATE_ACTIVE_FROM",
    "PROPERTY_*"
);
$arFilter = Array(
    "IBLOCK_ID" => 9,
    "ACTIVE" => "Y",
    "NAME" => ""
 );

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question