use Bitrix\Main\Loader; AddEventHandler("sale", "OnSaleStatusOrder", "OrderComplete"); function OrderComplete($orderID, &$arFields) { Loader::includeModule("sale"); if ($arFields == 'F') { $order = \Bitrix\Sale\Order::load($orderID); $orderUser = $order->getUserId(); $orderSumm = $order->getPrice(); $bonusPercent = orderSumm * 3 / 100; CSaleUserAccount::UpdateAccount( $orderUser, $bonusPercent, "RUB", false, $orderID, false ); } } } }
[RuntimeException] 
Could not start session because headers have already been sent. "/home/b/bazaklfm/bazaklfm.beget.tech/public_html/local/php_interface/init.php":1. (0)
/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/modules/main/lib/session/session.php:133
#0: Bitrix\Main\Session\Session->start()
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/modules/main/lib/session/kernelsessionproxy.php:42
#1: Bitrix\Main\Session\KernelSessionProxy->start()
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/modules/main/include.php:166
#2: require_once(string)
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/modules/main/include/prolog_before.php:14
#3: require_once(string)
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/modules/main/include/prolog.php:10
#4: require_once(string)
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/bitrix/header.php:1
#5: require(string)
	/home/b/bazaklfm/bazaklfm.beget.tech/public_html/company/requisites/index.php:2