Answer the question
In order to leave comments, you need to log in
Why are fewer items displayed than in the array in catalog.section?
Hello. I was confused about the output of TP to the directory.
In result_modifier I get TP
$offersItemId = array();
foreach ($arResult['ITEMS'] as $item){
$IBLOCK_ID = $arParams["IBLOCK_ID"];
$ID = $item['ID'];
$arInfo = CCatalogSKU::GetInfoByProductIBlock($IBLOCK_ID);
if (is_array($arInfo))
{
$rsOffers = CIBlockElement::GetList(array(),array('IBLOCK_ID' => $arInfo['IBLOCK_ID'], 'PROPERTY_'.$arInfo['SKU_PROPERTY_ID'] => $ID));
while ($arOffer = $rsOffers->GetNext())
{
$offersItemIblock = $arOffer["IBLOCK_ID"];
$offersItemId[] = $arOffer["ID"];
}
}
}
$arOfferItem = array();
$arFilter = Array("IBLOCK_ID"=>$offersItemIblock, "ID"=>$offersItemId);
$arSelect = Array("*");
$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, array(), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
$arFields["PROPERTIES"] = $ob->GetProperties();
$arOfferItem[] = $arFields;
}
//echo '<pre>'; print_r($arOfferItem); echo '</pre>';
//$arResult["ITEMS"] = $arOfferItem;
echo '<pre>'; print_r($arOfferItem); echo '</pre>';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question