Y
Y
Yaroslava2019-03-13 15:42:55
1C-Bitrix
Yaroslava, 2019-03-13 15:42:55

How to make it so that New items are displayed first in the Bitrix catalog?

It is necessary to make sure that the catalog page displays first the products with the New items property.
In the parameter settings of the bitrix:catalog component (List settings), it is proposed to sort the product by the number of views on average, sorting index, modification date, name, ID, activity date (from), activity date (to). There are no novelties in this list (theoretically, you can probably sort by ID (in descending order) - the essence will be about the same).
However, when changing the settings, nothing happens. The cache was dropped.
Maybe it's some wrong settings? Or should it be done differently?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Savrasov, 2019-03-14
@IIIamJameson

The easiest option is to sort by ID
Sort 2, set both sorts by ID from highest to lowest.
If you have a template and there is a sort selector, then this method may not work.
In the bitrix:catalog component in one of the files
- section.php
- section_horizontal.php
- section_vertical.php
There should be a call to the catalog.section component
It should be like this

"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"],

If $arParams["ELEMENT_SORT_FIELD"] is NOT there, then it means that there is a variable into which the default sort value is passed above.
As a crutch, if you are too lazy to disassemble, you can change to
"ELEMENT_SORT_FIELD" => "ID",
"ELEMENT_SORT_ORDER" => "DESC",
"ELEMENT_SORT_FIELD2" => "ID",
"ELEMENT_SORT_ORDER2" => "DESC",

But you should understand that the functionality of sorting by buyers, if any, may fall off.

A
Alexey, 2019-03-15
@AlexeyCaTHaR

Or sort by the time the product was added

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question