Answer the question
In order to leave comments, you need to log in
Is it possible to apply different sortings in one component, depending on the properties?
Good afternoon.
The task is as follows - it is necessary to fasten the button "up to raise the object to the top of the catalog". Started property up, I put a daw.
if(empty($arrFilter)&&empty($sortBy)) {//только при пустом фильтре и сортировке
$sortBy='property_up';
$orderBy='desc';
}
$intSectionID = $APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"catalog_" . (isset($currentSection) ? $templateView : 'cards'),
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"ELEMENT_SORT_FIELD" => $sortBy,
"ELEMENT_SORT_ORDER" => $orderBy,
"ELEMENT_SORT_FIELD2" => $arParams["ELEMENT_SORT_FIELD2"],
"ELEMENT_SORT_ORDER2" => $arParams["ELEMENT_SORT_ORDER2"],
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