$this->SetViewTarget("additionalFilterButtons");
//html
$this->EndViewTarget();
$bxEventManager->addEventHandler(
"main",
"OnAdminTabControlBegin",
array(
ProductTabs::class,
"addMailEventsTab"
)
);
// обработчик события
function addMailEventsTab(&$form)
{
$iblockId = intval($_REQUEST["IBLOCK_ID"]);
$productId = intval($_REQUEST["ID"]);
Loader::includeModule("catalog");
if (
($GLOBALS["APPLICATION"]->GetCurPage() == "/bitrix/admin/iblock_element_edit.php")
&& (CatalogIblockTable::getList([
"filter" => ["IBLOCK_ID" => $iblockId]
])->getSelectedRowsCount() > 0
)
) {
$className = __CLASS__;
/** @var ProductTabs $tabManager */
$tabManager = new $className();
$tabManager->addQuantityReservedTab($form, $productId);
if($productId > 0){
$tabManager->addBarcodeTab($form, $productId);
}
}
}
$order = \Bitrix\Sale\Order::load(1);
/** @var \Bitrix\Sale\Shipment $shipment */
$shipment = $order->getShipmentCollection()->getItemByIndex(0);//тут беру первую попавшуюся отгрузку, это не корректно, используется в качестве примера
$extraServices = $shipment->getExtraServices();//это доп услуги
global $USER;
$needUserGroup = 1; //группа которую проверяете
if(in_array($needUserGroup, $USER->GetUserGroupArray())){
//ваш код
}
$rsData = CSearchStatistic::GetList(array($by => $order), $arFilter, $arFields, true);
$select = [
"IBLOCK_ID",
"SECTION_ID" => "ID",
"SECTION_NAME" => "NAME",
"PARENT_ID" => "ROOT_SECTION.ID",
"PARENT_NAME" => "ROOT_SECTION.NAME",
];
$iblockId = 12;
$sections = [437, 494, 482];//массив из ID разделов для которых нужно получить корневые разделы
/** @var class-string<SectionTable> $entity */
$entity = \Bitrix\Iblock\Model\Section::compileEntityByIblock($iblockId);
$dbNavChain = $entity::getList([
"select" => $select,
"filter" => [
"=IBLOCK_ID" => $iblockId,
"ID" => $sections,
"=ROOT_SECTION.DEPTH_LEVEL" => 1
],
'runtime' => [
'ROOT_SECTION' => [
'data_type' => $entity,
'reference' => [
'=ref.IBLOCK_ID' => new \Bitrix\Main\DB\SqlExpression('?i', $iblockId),
'>this.LEFT_MARGIN' => 'ref.LEFT_MARGIN',
'<this.RIGHT_MARGIN' => 'ref.RIGHT_MARGIN',
]
]
],
"order" => [
"ROOT_SECTION.LEFT_MARGIN" => "ASC"
],
"cache" => [
"ttl" => 86400
]
]);
$result = [];
while ($navChain = $dbNavChain->fetch()) {
$section = [
"ID" => $navChain["PARENT_ID"],
"IBLOCK_ID" => $navChain["IBLOCK_ID"],
"NAME" => $navChain["PARENT_NAME"],
];
$result[$navChain["SECTION_ID"]] = $section;
}
print_r($result);
Array
(
[437] => Array
(
[ID] => 75
[IBLOCK_ID] => 12
[NAME] => Гель-лаки
)
[482] => Array
(
[ID] => 338
[IBLOCK_ID] => 12
[NAME] => Инструменты
)
[494] => Array
(
[ID] => 338
[IBLOCK_ID] => 12
[NAME] => Инструменты
)
)
$orderObj = Sale\Order::load($ar_orders['ID']);
$discounts = $orderObj->getDiscount();
$res = $discounts->getApplyResult(true);
let s_pos = this.basketUrl.indexOf("/?action=");
this.basketUrl = this.basketUrl.slice(s_pos);
\Bitrix\Iblock\Elements\ElementCatalogTable::getList([
"select" => [
"ID", "NAME",
"BRAND_VALUE" => "BRAND.VALUE",//BRAND - это символьный код свойства
]
])