K
K
Kirill Rezanov2022-04-19 17:39:54
1C-Bitrix
Kirill Rezanov, 2022-04-19 17:39:54

How to send data on an order after placing it in Bitrix?

I want information about this order to be sent to the delivery service after placing an order, but how can I do this? I'm trying to send via this:

use Bitrix\Main; 
Main\EventManager::getInstance()->addEventHandler(
    'sale',
    'OnSaleOrderSaved',
    'sendOrder'
);

function sendOrder(Main\Event $event)
{
    /** @var Order $order */
    $order = $event->getParameter("ENTITY");
    $oldValues = $event->getParameter("VALUES");
    $isNew = $event->getParameter("IS_NEW");

    if ($isNew)
    {
        var_dump($order);
    }
}

But the function doesn't work, what's the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2022-04-19
@idruweb

try dumping to a file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question