Answer the question
In order to leave comments, you need to log in
Why does the search search by the ID of the IB element, but not by the name?
I can't figure out what the problem is. There are IB brands with a couple of dozen elements - when I enter the name of an element in the search (in my case, the brand) - 0 results, I drive in its ID - everything is shown ...
there are suspicions that something is wrong in the contents of the result_modifier.php file
<?
if($arResult["SEARCH"]){
$arID = array();
foreach($arResult["SEARCH"] as $i => $arItem)
{
if($arItem["MODULE_ID"] == "iblock" && substr($arItem["ITEM_ID"], 0, 1) != "S")
$arID[$arItem["ITEM_ID"]] = $i;
}
if (!empty($arID) && CModule::IncludeModule('iblock'))
{
$grab = CIBlockElement::GetList(array('ID'=>'ASC'),array("ID" =>array_keys($arID)),false,false,array("ID","IBLOCK_ID","PREVIEW_PICTURE","CATALOG_GROUP_1"));
while($ar = $grab->Fetch()){
$arResult["SEARCH"][$arID[$ar["ID"]]]["IBLOCK_ID"] = $ar['IBLOCK_ID'];
$arResult["SEARCH"][$arID[$ar["ID"]]]["PICTURE"] = CFile::GetFileArray($ar["PREVIEW_PICTURE"]);
$arResult["SEARCH"][$arID[$ar["ID"]]]["CATALOG_PRICE_1"]=$ar['CATALOG_PRICE_1']*1;
$arResult["SEARCH"][$arID[$ar["ID"]]]['PRICE'] = CCatalogDiscount::GetDiscountByProduct(
$ar["ID"],
$USER->GetUserGroupArray(),
"N",
1,
SITE_ID
);
}
}
} ?>
Answer the question
In order to leave comments, you need to log in
CIBlockElement::GetList
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question