I
I
issssrt2019-02-25 15:40:58
1C-Bitrix
issssrt, 2019-02-25 15:40:58

How to trigger event in bitrix sale order ajax?

Upon successful checkout, you need to call the code that sends data to crm, as I understand it, can this be done by registering an event? I myself am not friends with Bitrix, I smoke mana.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Panteleev, 2019-02-25
@issssrt

Use the event to save the order OnSaleOrderSaved

$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('sale', 'OnSaleOrderSaved', 'OnSaleOrderSavedHandler');

function OnSaleOrderSavedHandler(\Bitrix\Main\Event $event) {
    $order = $event->getParameter('ENTITY');
    $oldValues = $event->getParameter('VALUES');
    $isNew = $event->getParameter('IS_NEW');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question