Answer the question
In order to leave comments, you need to log in
Bitrix:catalog.smart.filter sorting values in property lists?
How to automatically sort the values in the lists of properties alphabetically in the "Smart Filter" of Bitrix??? I know about manual sorting - but there are too many parameters, so it's not an option. The documentation was reviewed 100 times - there is no answer there.
Answer the question
In order to leave comments, you need to log in
Solved the problem with a crutch.
In the standard smart filter template file catalog.smart.filter/.default/template.php add the following code after line 156
<? //Сортировка по алфавиту
foreach ($arItem["VALUES"] as $key => $sortkey) {
$values[$key] = $sortkey['VALUE'];
}
array_multisort($values, SORT_ASC, $arItem['VALUES']);
unset($values);
?>
It depends on the type of property, I use element binding more often (and I advise everyone to do the same), in which case the property values can be sorted by the sort field
(does not work with element binding with autocomplete, I think this is only in older versions of the kernel)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question