I
I
itemashabanov2021-05-20 16:23:45
1C-Bitrix
itemashabanov, 2021-05-20 16:23:45

How to implement the output of the goods "First in ..."?

Hello. How can I make sure that on the page of the catalog of goods, when clicking on the button, the goods are sorted in such an order that goods from one warehouse are shown first, and only then all the others? For now, I do this: I get the quantity of goods in the warehouse and the warehouse ID, write it to the array of element fields, then sort the resulting array by warehouse ID, and put all the elements of the array with the desired warehouse at the beginning of the array. My heart tells me that this is some kind of crap) Can someone tell me a more "reasonable" solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-05-21
@itemashabanov

In the component call, you can specify sorting by warehouse

"ELEMENT_SORT_FIELD" => "CATALOG_STORE_AMOUNT_<идентификатор_склада>",
"ELEMENT_SORT_ORDER" => "desc",

and specify the second sort

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question