R
R
redesupar2022-03-09 17:07:53
1C-Bitrix
redesupar, 2022-03-09 17:07:53

Prohibition of subsection output to Bitrix?

Hello, there are 2 sites (multi-site) that use one infoblock.
I want one of the sites to be displayed without two subsections, how can this be done through a filter?

$price_subsection_id=array();
$price_subsection_id[]=3955;
$price_subsections=array();
if(CModule::IncludeModule("iblock")){
  	$rsParentSection = CIBlockSection::GetByID(3955);
  if ($arParentSection = $rsParentSection->GetNext())
  {
     $arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'],'>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'],'<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'],'>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL'],'ACTIVE' => 'Y');
     $rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilter,true,['ID', "NAME", 'DEPTH_LEVEL', "IBLOCK_SECTION_ID"]);
     while ($ar_result = $rsSect->GetNext())
     {
      	$price_subsections[]   = $ar_result;
      $price_subsection_id[] =$ar_result['ID'];
     }
  }

}


$GLOBALS['arrFilter'] = array('PROPERTY_SECTION' => $price_subsection_id);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question