Answer the question
In order to leave comments, you need to log in
How to implement a phone number change when choosing a city on Bitrix?
Hello!
I'm trying to implement a change of context on the choice of the city on Bitrix.
Without connecting to any geo-base, because the number of cities is known.
Moscow and Peter.
When you enter the site, a window pops up, there is a RADIO BUTTON And the Select button Choose
Peter at the bottom of the page, the phone number changes.
I created an infoblock with the name of the city and the PHONE property
. I use bitrix.news.list
Here is my code without popup.
<div class="news-list">
<?foreach($arResult["ITEMS"] as $arItem):?>
<?if($arParams["DISPLAY_NAME"]!="N" && $arItem["NAME"]):?>
<?if(!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])):?>
<form name ="" method ="post">
<input type="radio" name="r"><b><?echo $arItem["NAME"]?></b><br />
<?endif;?>
<?endif;?>
<?endforeach;?>
<input type = "submit" value = "Выбрать">
</form>
</div>
</div>
<?if (isset($_POST['r'])):?>
<?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<div id="telephone"> <?=$arProperty["DISPLAY_VALUE"];?></div><br />
<?endforeach;?>
<?endif?>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question