Answer the question
In order to leave comments, you need to log in
Do you need to create a cms bitrix module and make it react to the OnSaleOrderBeforeSaved event?
Hello, I’m trying to make such a problem so that the Bitrix module would work for me on the OnSaleBeforeOrder event. I created the module, connected all the connections went fine, I register the event in the install/index.php file in InstallEvent, through the EventManager::getInstance()->registerEventHandler command, but for some reason nothing works, I just want to intercept the order at the time of registration and change some data. Here's what should happen after the event is caught.
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt");
/** @var Order $order */
$order = $event->getParameter("ENTITY");
$order->setField('COMMENTS', 'New comments');
$event->addResult(
new Main\EventResult(
Main\EventResult::SUCCESS, $order
)
);
Answer the question
In order to leave comments, you need to log in
Most likely an error in registering an event from a banal typo to mixed up relationships. Check what your event subscription looks like in the b_module_to_module table
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question