"select" => [
"*",
"SECTION_NAME" => "SECTION.NAME",
"PRICE" => "PRICE_LIST.PRICE",
"QUANTITY" => "PRODUCT.QUANTITY",
],
'runtime' => [
'PRICE_LIST' => [
'data_type' => \Bitrix\Catalog\PriceTable::class,
'reference' => [
'=this.ID' => 'ref.PRODUCT_ID',
],
'join_type' => 'left'
],
'PRODUCT' => [
'data_type' => \Bitrix\Catalog\ProductTable::class,
'reference' => [
'=this.ID' => 'ref.ID',
],
'join_type' => 'left'
],
'SECTION' => [
'data_type' => \Bitrix\Iblock\SectionTable::class,
'reference' => [
'=this.IBLOCK_SECTION_ID' => 'ref.ID',
],
'join_type' => 'left'
],
],
$img = CFile::GetPath($product['PREVIEW_PICTURE']);
$URL = $APPLICATION->GetCurDir();
if ($URL != $arResult[SEF_SET_FILTER_URL]) {
//echo 'ERROR 404';CHTTP::SetStatus("404 Not Found");
//@define("ERROR_404","Y");
//если раскомментировать - выдаст 404, иначе ниже - делаем редирект
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$arResult[SEF_SET_FILTER_URL]);
exit();
}
<?php
header('Access-Control-Allow-Origin: *');
// Ваш код
?>
const groupedArr2 = arr2.reduce((acc, n) => {
(acc[n.parent_id] = acc[n.parent_id] || []).push(n);
return acc;
}, {});
arr1.forEach(n => n.arr2 = groupedArr2[n.id] || []);
const newArr1 = arr1.map(n => ({ ...n, arr2: groupedArr2[n.id] || [] }));