A
A
Andrey Zhigunovsky2019-09-12 14:22:47
1C-Bitrix
Andrey Zhigunovsky, 2019-09-12 14:22:47

How is the kernel connected to the module?

I do event handling in my module, but I can't use the Bitrix API methods, it gives the following error:
Class 'Redmarketing\Robotats\EventHandlers\CModule' not found (0)
connected the prologue, but it doesn't help.
<?
namespace Redmarketing\Robotats\EventHandlers;
use Bitrix\Main\Localization;
use Bitrix\Main\Config\Option;
Localization\Loc::loadMessages(__FILE__);
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
class OnSaleStatusOrderHandler{
static public function handler($ID, $val){
// swears at this
line CModule::includeModule("sale");
$db_props = CSaleOrderPropsValue::GetOrderProps($ID);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2019-09-12
@zhigunov2

\CModule::includeModule("sale"); or \Bitrix\Main\Loader::includeModule('sale');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question