T
T
tgarl2020-05-13 14:18:05
1C-Bitrix
tgarl, 2020-05-13 14:18:05

How to display elements in a specific order?

The crux of the matter is this. There is a catalog.section, you need to raise the goods in it of a certain line / brand to the top of the list.

In mysql this can be done with ORDER BY FIELD()
How can this be done via a component?

Options for customizing the component are also being considered ((

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Irina, 2020-05-13
@iitovka

You can write a handler for adding-editing an element, and there you can write your own processing and change the SORT field of the element according to the desired principle. (or not the SORT field at all, but a separate property / properties, and enable sorting by this property)

R
Ruslan, 2020-05-13
@shahruslan

If the brand is an infoblock, then you can
'PROPERTY_BRAND.SORT' => 'ASC'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question