На сайте используется стандартный компонент catalog.smart.filter со шаблоном .default по дизайну нужно вывести свойства HIT и ACTIONS перед выбором цены
prntscr.com/fv4qks
В шаблоне идет условие вывода цены в начале.
Пробовал указать вывод массива, но получается, что он выводится 2 раза в начале и по уровню сортировки.
Шаблон фильтра:
<div class="row full-row">
<?foreach($arResult["ITEMS"] as $key=>$arItem)//prices
{
$key = $arItem["ENCODED_ID"];
if(isset($arItem["PRICE"])):
if ($arItem["VALUES"]["MAX"]["VALUE"] - $arItem["VALUES"]["MIN"]["VALUE"] <= 0)
continue;
$precision = 2;
if (Bitrix\Main\Loader::includeModule("currency"))
{
$res = CCurrencyLang::GetFormatDescription($arItem["VALUES"]["MIN"]["CURRENCY"]);
$precision = $res['DECIMALS'];
}
?>
<div class="<?if ($arParams["FILTER_VIEW_MODE"] == "HORIZONTAL"):?>col-sm-6 col-md-4<?else:?>col-lg-12<?endif?> bx-filter-parameters-box bx-active">
<span class="bx-filter-container-modef"></span>
<div class="bx-filter-parameters-box-title" onclick="smartFilter.hideFilterProps(this)"><span><?=$arItem["NAME"]?> <i data-role="prop_angle" class="fa fa-angle-<?if ($arItem["DISPLAY_EXPANDED"]== "Y"):?>up<?else:?>down<?endif?>"></i></span></div>
<div class="bx-filter-block" data-role="bx_filter_block">
<div class="row bx-filter-parameters-box-container">
<div class="col-xs-6 bx-filter-parameters-box-container-block bx-left">
<i class="bx-ft-sub"><?=GetMessage("CT_BCSF_FILTER_FROM")?></i>
<div class="bx-filter-input-container">
<input
class="min-price"
type="text"
name="<?echo $arItem["VALUES"]["MIN"]["CONTROL_NAME"]?>"
id="<?echo $arItem["VALUES"]["MIN"]["CONTROL_ID"]?>"
value="<?echo $arItem["VALUES"]["MIN"]["HTML_VALUE"]?>"
size="5"
onkeyup="smartFilter.keyup(this)"
placeholder="от"
/>
</div>
</div>
<div class="col-xs-6 bx-filter-parameters-box-container-block bx-right">
<i class="bx-ft-sub"><?=GetMessage("CT_BCSF_FILTER_TO")?></i>
<div class="bx-filter-input-container">
<input
class="max-price"
type="text"
name="<?echo $arItem["VALUES"]["MAX"]["CONTROL_NAME"]?>"
id="<?echo $arItem["VALUES"]["MAX"]["CONTROL_ID"]?>"
value="<?echo $arItem["VALUES"]["MAX"]["HTML_VALUE"]?>"
size="5"
onkeyup="smartFilter.keyup(this)"
placeholder="до"
/>
</div>
</div>
<div class="col-xs-10 col-xs-offset-1 bx-ui-slider-track-container">
<div class="bx-ui-slider-track" id="drag_track_<?=$key?>">
<?
$precision = $arItem["DECIMALS"]? $arItem["DECIMALS"]: 0;
$step = ($arItem["VALUES"]["MAX"]["VALUE"] - $arItem["VALUES"]["MIN"]["VALUE"]) / 4;
$price1 = number_format($arItem["VALUES"]["MIN"]["VALUE"], $precision, ".", "");
$price2 = number_format($arItem["VALUES"]["MIN"]["VALUE"] + $step, $precision, ".", "");
$price3 = number_format($arItem["VALUES"]["MIN"]["VALUE"] + $step * 2, $precision, ".", "");
$price4 = number_format($arItem["VALUES"]["MIN"]["VALUE"] + $step * 3, $precision, ".", "");
$price5 = number_format($arItem["VALUES"]["MAX"]["VALUE"], $precision, ".", "");
?>
<div class="bx-ui-slider-part p1"><span><?=$price1?></span></div>
<div class="bx-ui-slider-part p2"><span><?=$price2?></span></div>
<div class="bx-ui-slider-part p3"><span><?=$price3?></span></div>
<div class="bx-ui-slider-part p4"><span><?=$price4?></span></div>
<div class="bx-ui-slider-part p5"><span><?=$price5?></span></div>
<div class="bx-ui-slider-pricebar-vd" style="left: 0;right: 0;" id="colorUnavailableActive_<?=$key?>"></div>
<div class="bx-ui-slider-pricebar-vn" style="left: 0;right: 0;" id="colorAvailableInactive_<?=$key?>"></div>
<div class="bx-ui-slider-pricebar-v" style="left: 0;right: 0;" id="colorAvailableActive_<?=$key?>"></div>
<div class="bx-ui-slider-range" id="drag_tracker_<?=$key?>" style="left: 0%; right: 0%;">
<a class="bx-ui-slider-handle left" style="left:0;" href="javascript:void(0)" id="left_slider_<?=$key?>"></a>
<a class="bx-ui-slider-handle right" style="right:0;" href="javascript:void(0)" id="right_slider_<?=$key?>"></a>
</div>
</div>
</div>
</div>
</div>
</div>
<?
$arJsParams = array(
"leftSlider" => 'left_slider_'.$key,
"rightSlider" => 'right_slider_'.$key,
"tracker" => "drag_tracker_".$key,
"trackerWrap" => "drag_track_".$key,
"minInputId" => $arItem["VALUES"]["MIN"]["CONTROL_ID"],
"maxInputId" => $arItem["VALUES"]["MAX"]["CONTROL_ID"],
"minPrice" => $arItem["VALUES"]["MIN"]["VALUE"],
"maxPrice" => $arItem["VALUES"]["MAX"]["VALUE"],
"curMinPrice" => $arItem["VALUES"]["MIN"]["HTML_VALUE"],
"curMaxPrice" => $arItem["VALUES"]["MAX"]["HTML_VALUE"],
"fltMinPrice" => intval($arItem["VALUES"]["MIN"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MIN"]["FILTERED_VALUE"] : $arItem["VALUES"]["MIN"]["VALUE"] ,
"fltMaxPrice" => intval($arItem["VALUES"]["MAX"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MAX"]["FILTERED_VALUE"] : $arItem["VALUES"]["MAX"]["VALUE"],
"precision" => $precision,
"colorUnavailableActive" => 'colorUnavailableActive_'.$key,
"colorAvailableActive" => 'colorAvailableActive_'.$key,
"colorAvailableInactive" => 'colorAvailableInactive_'.$key,
);
?>
<script type="text/javascript">
BX.ready(function(){
window['trackBar<?=$key?>'] = new BX.Iblock.SmartFilter(<?=CUtil::PhpToJSObject($arJsParams)?>);
});
</script>
<?endif;
}
//not prices
foreach($arResult["ITEMS"] as $key=>$arItem)
{
if(
empty($arItem["VALUES"])
|| isset($arItem["PRICE"])
)
continue;
if (
$arItem["DISPLAY_TYPE"] == "A"
&& (
$arItem["VALUES"]["MAX"]["VALUE"] - $arItem["VALUES"]["MIN"]["VALUE"] <= 0
)
)
continue;
?>