G
G
Good Samaritan2021-02-06 17:59:48
1C-Bitrix
Good Samaritan, 2021-02-06 17:59:48

How to add custom properties to the handler?

I have a task, when paying for an order, send an email to the selected warehouse. How to get the selected warehouse in the event handler:

AddEventHandler("sale", "OnSalePayOrder", "SendEmail");
function sendEmail(){
$sklad_id= //?????
}
// как получить его значение $sklad_id на странице оформления заказа оно выводится так:
<div class="inputCell">
        <?//выбор склада
        $rsStore = \Bitrix\Catalog\StoreTable::getList(array(
            'filter' => array('ACTIVE'>='Y'),
        ));
        $store_ar=[];
        while($arStore=$rsStore->fetch())
        {
            $store_ar[$arStore['ID']]=$arStore['TITLE']." : ".$arStore['ADDRESS'];
        }
        ?>
        <select class="selector"  name="STORE_ID">
            <option>Не выбрано</option>
            <? foreach ($store_ar as $key=>$value): ?>
                <option value="<?=$key?>"><?=$value?></option>
            <? endforeach; ?>
        </select>
    </div>

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