A
A
Ainur Valiev2019-01-22 11:56:15
1C-Bitrix
Ainur Valiev, 2019-01-22 11:56:15

Why sorting in Bitrix works only on the current page, but not on the entire result (during pagination)?

Pagination is enabled on the search page. Sorting of the search result works, but only on the current page. When you switch to the 2nd page, everything is sorted there only for this page. Is it possible to sort the entire result at once?

$arParams["ELEMENT_SORT_FIELD"] = "CATALOG_PRICE_".$codepr;

$APPLICATION->IncludeComponent(
        "bitrix:catalog.section", 
         "",
        array(
            "ELEMENT_SORT_FIELD" => $arParams["ELEMENT_SORT_FIELD"],
            "ELEMENT_SORT_ORDER" => $arParams["ELEMENT_SORT_ORDER"],
            "ELEMENT_SORT_FIELD2" => $arParams["ELEMENT_SORT_FIELD2"],
            "ELEMENT_SORT_ORDER2" => $arParams["ELEMENT_SORT_ORDER2"],
...


 <?=$APPLICATION->ShowViewContent("search_pagination");?>

PS Problem solved. It was trite to remove pagination of the bitrix:search.page component itself and enable it for the bitrix:catalog.section component

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-01-22
@idruweb

most likely the sort parameter is not passed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question