Answer the question
In order to leave comments, you need to log in
The script for displaying products in the catalog does not work, provided why?
Good afternoon. There is a task to hide the display of products in the catalog if there is no checkmark in the user field.
Script written:
$arSelect = Array(
"ID",
"SECTION_PAGE_URL"
);
$arFilter = Array(
"IBLOCK_ID" => 34,
"!UF_SHOW_HEAD_MENU"=> 0,
"ACTIVE" => "Y"
);
$res = CIBlockSection::GetList(Array(), $arFilter, false, $arSelect);
$arTemp = array();
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
$arTemp[$arFields["SECTION_PAGE_URL"]] = $arFields;
}
unset($res);
$arTempResult = array();
foreach ($arResult as &$arMenuItem)
{
if ($arTemp[$arMenuItem['LINK']])
{
$arTempResult[] = $arMenuItem;
}
}
$arResult = $arTempResult;
unset($arTemp);
unset($arTempResult);
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