$arProp['CML2_LINK'] = $PRODUCT_ID;
$arFields = array(
'NAME' => $sku['item_name'],
'IBLOCK_ID' => CATALOG_SKU_ID,
'ACTIVE' => $sku['st'] ? 'Y' : 'N',
'PROPERTY_VALUES' => $arProp
);
if($intOfferID = $el->Add($arFields)){
$priceFields = [
'CATALOG_GROUP_ID' => 1,
'PRICE' => $sku['item_price'],
'CURRENCY' => 'RUB',
'PRODUCT_ID' => $intOfferID,
];
$prodFields = [
"ID" => $intOfferID,
"QUANTITY" => 1,
"AVAILABLE" => $sku['in_storage'],
"WEIGHT" => $sku['item_weight'],
"TYPE" => \Bitrix\Catalog\ProductTable::TYPE_OFFER
];
if($resSku = \Bitrix\Catalog\Model\Product::add($prodFields)){
$resPrice = \Bitrix\Catalog\Model\Price::add($priceFields);
if ($resPrice->isSuccess()){
echo "price added " . $resPrice->getId();
}else{
$error = implode('<br>', $resPrice->getErrorMessages());
echo ($error !== '' ? $error : 'ошибка при создании цены');
}
}else{
echo 'Error create sku';
}
}else{
echo "Error sku: ".$el->LAST_ERROR;
}
global $arFilterTags;
$arFilterTags = Array("UF_MAIN_PAGE_TAGS"=> 1, "ACTIVE" => "Y");
$APPLICATION->IncludeComponent(
"bitrix:catalog.section.list",
"main-track",
array(
"COMPONENT_TEMPLATE" => "main-track",
"IBLOCK_TYPE" => "catalogs",
"IBLOCK_ID" => "5",
"SECTION_ID" => "",
"SECTION_CODE" => "",
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => "1",
"SECTION_FIELDS" => array(
0 => "",
1 => "",
),
"SECTION_USER_FIELDS" => array(
0 => "UF_MAIN_PAGE_TAGS",
1 => "",
),
"SECTION_URL" => "",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "36000000",
"CACHE_GROUPS" => "Y",
"ADD_SECTIONS_CHAIN" => "N",
"FILTER_NAME" => "arFilterTags"
),
false
);
но блок дергается