if(!$arItem['DETAIL_PAGE_URL']) { $mxResult = CCatalogSku::GetProductInfo($arItem["PRODUCT_ID"]); $rsElements=CIBlockElement::GetById($mxResult['ID']); $rsElements->SetUrlTemplates("/catalog/#SECTION_CODE#/#ELEMENT_CODE#/"); if($tempElement = $rsElements->GetNext()) { $arItem['DETAIL_PAGE_URL']=$tempElement['DETAIL_PAGE_URL']; } } $arNewItems[$k]=$arItem;