array(
"FROM_IBLOCK" => true,
"IS_PARENT" => false,
"DEPTH_LEVEL" => $arSection["DEPTH_LEVEL"],
),
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('catalog', '\Bitrix\Catalog\Subscribe::onAfterAdd', ['СatalogEvents', 'onAfterAddSubscribe']);
Как создать еще одно своё поле
прописать такие методы чтобы они работали по типу ->setDescription($ob->description)
\Bitrix\Main\Loader::includeModule('sale');
$orderId = 1;
$dbRes = \Bitrix\Sale\Internals\OrderTable::getList(array(
'filter' => array(
'ORDER_ID' => $orderId
),
'select' => array('SOURCE_NAME' => 'TRADING_PLATFORM.NAME')
));
if($tpOrder = $dbRes->fetch())
$sourceName = $tpOrder['SOURCE_NAME'];
"SEF_URL_TEMPLATES" => array(
//...........
"element" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/",
"manual" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/myprotectionproduct/manual/",
)
$arTemplateParameters['SEF_URL_TEMPLATES_manual'] = array(
'PARENT' => 'SEF_MODE',
'NAME' => GetMessage('PARAMETER_SEF_URL_TEMPLATES_MANUAL'),
"DEFAULT" => "",
"VARIABLES" => array(),
);
$MESS['PARAMETER_SEF_URL_TEMPLATES_MANUAL'] = 'Мануал';
\Bitrix\Main\Loader::includeModule('sale');
$orderId = 10;
$order = \Bitrix\Sale\Order::load($orderId);
if(!empty($order)) {
$basket = $order->getBasket();
foreach($basket->getBasketItems() as $basketItem) {
$basketPropertyCollection = $basketItem->getPropertyCollection();
print_r($basketPropertyCollection->getPropertyValues());
}
}
$newStatusId = 'F';
$order->setField('STATUS_ID', $newStatusId);
$order->save();
init: function()
{
// ................
if (!this.obPict)
{
this.errorCode = -2;
}
// ................
if (!this.obPictSlider)
{
this.errorCode = -4;
}
// ................
if (this.errorCode === 0)
{
// здесь все инициализируется, добавление в корзину в том числе
BX.ready(function() {
var toorderButton = document.querySelector('[data-param-form_id="TOORDER"]');
if(toorderButton) {
toorderButton.setAttribute('data-param-form_id', '19');
toorderButton.setAttribute('data-name', 'feedback');
}
});
\Bitrix\Main\UI\Extension::load('amcharts4');
'INCLUDE_SUBSECTIONS' => 'Y',
'SHOW_ALL_WO_SECTION' => 'Y',
'BY_LINK' => 'Y'
'AJAX_MODE' => 'Y',
'AJAX_OPTION_STYLE' => 'Y',
'AJAX_OPTION_HISTORY' => 'Y'
//.......
url: '<?=$APPLICATION->GetCurDir()?>'
data: {SECTION_ID: idSection, BRAND_AJAX: 'Y'}
//.......
<?
$request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest();
$bBrandAjax = $request->isAjaxRequest() && isset($request['BRAND_AJAX']) && $request['BRAND_AJAX'] == 'Y';
?>
<?// оборачиваешь в div для простоты вставки через js, можно поколдовать и сделать без этого контейнера, но тут уже сам))?>
<div id="ajax_brand_container">
<?
if($bBrandAjax) {
$APPLICATION->RestartBuffer();
}
// твой ajax-вый контент (вероятно только catalog.section)
if($bBrandAjax) {
die();
}
?>
</div>
var ajaxContainer = document.querySelector('#ajax_brand_container');
BX.ajax({
//........
onsuccess: async function(data) {
if(ajaxContainer) {
var obResult = BX.processHTML(data);
await !(function() {
ajaxContainer.innerHTML = data;
})();
BX.ajax.processScripts(obResult.SCRIPT);
}
}
//........
\Bitrix\Main\Loader::includeModule('catalog');
$iblockIds = [65, 66];
$elements = \Bitrix\Catalog\ProductTable::getList([
'select' => ['ELEMENT_ID' => 'IBLOCK_ELEMENT.ID', 'ELEMENT_NAME' => 'IBLOCK_ELEMENT.NAME', 'QUANTITY'],
'filter' => ['IBLOCK_ELEMENT.IBLOCK_ID' => $iblockIds, '>QUANTITY' => 0]
])->fetchAll();
print_r($elements);
$elements = [];
$iblockIds = [65, 66];
$iterator = \CIBlockElement::GetList(['ID' => 'ASC'], ['IBLOCK_ID' => $iblockIds, '>PROPERTY_SVOB_OZHIDAEMYY_OSTATOK' => 0], false, false, ['ID', 'NAME', 'PROPERTY_SVOB_OZHIDAEMYY_OSTATOK']);
while($row = $iterator->Fetch()) {
$elements[] = $row;
}
print_r($elements);
<?
//...................
// это не надо
/*
CModule::IncludeModule("iblock");
CModule::IncludeModule("catalog");
CModule::IncludeModule("sale");
*/
\Bitrix\Main\Loader::includeModule('catalog');
$iblockIds = [65, 66];
$elements = \Bitrix\Catalog\ProductTable::getList([
'select' => ['ELEMENT_ID' => 'IBLOCK_ELEMENT.ID', 'ELEMENT_NAME' => 'IBLOCK_ELEMENT.NAME', 'QUANTITY'],
'filter' => ['IBLOCK_ELEMENT.IBLOCK_ID' => $iblockIds, '>QUANTITY' => 0]
])->fetchAll();
// дальше все комментируешь до своей таблицы
?>
<?if($elements):?>
<table border="1" cellpadding="1" cellspacing="1" style="width: 850px">
<tbody>
<?foreach($elements as $element):?>
<tr>
<td style="width: 100px;"><?=$element['ELEMENT_ID'];?></td>
<td><?=$element['ELEMENT_NAME'];?></td>
<td style="width: 80px;"><?=$element['QUANTITY'];?></td>
</tr>
<?endforeach;?>
</tbody>
</table>
<?endif;?>
<?ob_start();?>
<?if($elements):?>
.................................................
<?endif;?>
<?$MESSAGE = ob_get_clean();?>