if (
is_array($this->arParams['RESTRICT_CHANGE_PAYSYSTEM'])
&& in_array($orderFields['STATUS_ID'], $this->arParams['RESTRICT_CHANGE_PAYSYSTEM'])
)
{
$orderFields['LOCK_CHANGE_PAYSYSTEM'] = 'Y';
}
AddEventHandler("iblock", "OnBeforeIBlockElementDelete", Array("MyClass", "OnBeforeIBlockElementDeleteHandler"));
class MyClass
{
function OnBeforeIBlockElementDeleteHandler($ID)
{
$res = CIBlockElement::GetByID($ID);
if($arItem = $res->GetNext()){
\Bitrix\Main\Diag\Debug::dumpToFile($arItem, 'arItem');
}
}
}
Bitrix\Main\Page\Asset::getInstance()->addCss("/path/to/css/style.css");
Bitrix\Main\Page\Asset::getInstance()->addJs("/path/to/js/script.js");
Mysql query error: (2006) MySQL server has gone away (400)
<?
array(
"IBLOCK_ID" => $iblock_ids,
"ACTIVE" => "Y",
array(
"LOGIC" => "OR",
array(
"SECTION_ACTIVE" => "Y",
"SECTION_GLOBAL_ACTIVE" => "Y"
),
array(
"IBLOCK_SECTION_ID" => 0,
)
),
)
[Bitrix\Main\NotImplementedException]
(140)
/bitrix/modules/sale/lib/orderbase.php:2069
#0: Bitrix\Sale\OrderBase::getList(array)
/bitrix/modules/sale/lib/orderbase.php:363
#1: Bitrix\Sale\OrderBase::loadFromDb(array)
/bitrix/modules/sale/lib/orderbase.php:292
#2: Bitrix\Sale\OrderBase::loadByFilter(array)
/test/index.php:7
$order = \Bitrix\Sale\Order::loadByFilter([
'filter' => ['XML_ID' => $xml]
]);
"PAYMENT_DATE_INSERT" => array(
"NAME" => Loc::getMessage("SALE_HPS_BILL_DATE"),
"SORT" => 100,
'GROUP' => 'PAYMENT',
"DESCRIPTION" => Loc::getMessage("SALE_HPS_BILL_DATE_DESC"),
'DEFAULT' => array(
"PROVIDER_VALUE" => "DATE_BILL_DATE",
"PROVIDER_KEY" => "PAYMENT"
)
),
"PAYMENT_DATE_PAY_BEFORE" => array(
"NAME" => Loc::getMessage("SALE_HPS_BILL_PAY_BEFORE"),
"DESCRIPTION" => Loc::getMessage("SALE_HPS_BILL_PAY_BEFORE_DESC"),
"SORT" => 300,
'GROUP' => 'PAYMENT',
'DEFAULT' => array(
"PROVIDER_VALUE" => "DATE_PAY_BEFORE",
"PROVIDER_KEY" => "ORDER"
)
),
use \Bitrix\Main\Data\Cache;
$cache = Cache::createInstance(); // получаем экземпляр класса
if ($cache->initCache(7200, "cache_key")) { // проверяем кеш и задаём настройки
$vars = $cache->getVars(); // достаем переменные из кеша
}
elseif ($cache->startDataCache()) {
// некоторые действия...
$cache->endDataCache(array("key" => "value")); // записываем в кеш
}
$updateResult = CSaleBasket::Update($id, array('QUANTITY' => $quantity));
if(!$updateResult){
print_r($APPLICATION->LAST_ERROR);
}
$basketItem = $basket->getItemById($id);
$basketItem->setField('QUANTITY', $quantity);
$orderSaveResult = $order->save();
if(!$orderSaveResult->isSuccess()){
var_dump($orderSaveResult->getErrors());
}
foreach(GetModuleEvents("sale", "OnBeforeBasketUpdate", true) as $arEvent){
var_dump($arEvent);
}