$code=$_GET['category'];
$rsParentSection = CIBlockSection::GetList(
['name' => 'asc'],
['IBLOCK_ID' => 22, 'ACTIVE' => 'Y', '?CODE' => $code,false, "PREVIEW_PICTURE" => false, "DETAIL_PICTURE" => false], false, ['*']
);
echo '<ul>';
while ($arParentSection = $rsParentSection->GetNext())
{
echo '<li class="one"><a href="?category='.$selectedCat[0].'&subcat=' .$arParentSection["CODE"]. '">'.$arParentSection["NAME"].'</a>';
$arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'], "PREVIEW_PICTURE" => false, "DETAIL_PICTURE" => false,'>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'],'<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'],'>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']);
$rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilter);
if ($rsSect){
echo '<ul class="first">';
while ($arSect = $rsSect->GetNext())
{
echo '<li class="second"><a href="?category='.$selectedCat[0].'&subcat=' .$arSect["CODE"]. '">'.$arSect["NAME"].'</a>';
$arFilterSub = array('IBLOCK_ID' => $arSect['IBLOCK_ID'], "PREVIEW_PICTURE" => false, "DETAIL_PICTURE" => false,'>LEFT_MARGIN' => $arSect['LEFT_MARGIN'],'<RIGHT_MARGIN' => $arSect['RIGHT_MARGIN'],'>DEPTH_LEVEL' => $arSect['DEPTH_LEVEL']);
$rsSectSub = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilterSub);
echo '<!--<pre>';
print_r($rsSectSub->result->num_rows);
echo '</pre>-->';
if ($rsSectSub->result->num_rows){
echo '<ul>';
while ($arSectSub = $rsSectSub->GetNext())
{
echo '<li class="three"><a href="?category='.$selectedCat[0].'&subcat=' .$arSectSub["CODE"]. '">'.$arSectSub["NAME"].'</a></li>';
}
echo '</ul>';
}
echo '</li><!--1-->';
}
echo '</ul>';
}
echo '</li>';
}
echo '<ul>';
npm run
. Верно?