set_time_limit(0);
ini_set("memory_limit", "-1");
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");
\Bitrix\Main\Loader::includeModule('sale');
$arFields = [
'LID' => 's1',
'NAME' => 'Тест ядра33',
'CURRENCY' => "RUB",
'ACTIVE_FROM' => '',
'ACTIVE_TO' => '',
'ACTIVE' => 'Y',
'SORT' => 100,
'PRIORITY' => 1,
'LAST_DISCOUNT' => 'Y',
'LAST_LEVEL_DISCOUNT' => 'N',
'XML_ID' => '',
'CONDITIONS' => [
'CLASS_ID' => 'CondGroup',
'DATA' => [
'All' => 'AND',
'True' => 'True',
],
'CHILDREN' => [
0 => [
'CLASS_ID' => 'CondBsktProductGroup',
'DATA' => [
'Found' => 'Found',
'All' => 'AND',
],
'CHILDREN' => [
'0' => [
'CLASS_ID' => 'CondBsktFldProduct',
'DATA' => [
'logic' => 'Equal',
'value' => '92',
]
]
]
]
]
],
'ACTIONS' => [
'CLASS_ID' => 'CondGroup',
'DATA' => [
'All' => 'AND',
],
'CHILDREN' => [
0 => [
'CLASS_ID' => 'ActSaleBsktGrp',
'DATA' => [
'Type' => 'Discount',
'Value' => 10,
'Unit' => 'Perc',
'Max' => 0,
'All' => 'AND',
'True' => 'True',
],
'CHILDREN' => []
]
]
],
'USER_GROUPS' => [1]
];
CSaleDiscount::Add($arFields);
Нужно было перенести директория с модулем
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");
if ( CModule::IncludeModule("catalog") ) {
$a = new CatalogProvider;
}
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php");
Class 'CatalogProvider' not found (0)