P
P
Pavel Sidorov2020-10-15 19:09:56
1C-Bitrix
Pavel Sidorov, 2020-10-15 19:09:56

How to sort by season Bitrix?

Good,
Let's say there is a catalog component, how to sort by season. Will explain. If it is winter, then the goods from the fur coat section will be the first to fall out, if autumn, then leather jackets, if summer, then skirts and blouses.
What should be the logical scheme of such sorting?
PS Without any buttons and so on. I went in - it was sorted as a standard variety.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2020-10-16
@anton99zel

Set a new property Season of the list type to the product.
Sort: propertysort_<PROPERTY_CODE>- by the sort index of the property value variant. Only for properties of type List.
Then write an update, which will change the sorting of the property in the infoblock for these 4 values. Bind to a condition - the value of the current month date.
https://dev.1c-bitrix.ru/api_help/iblock/classes/c...
This option will only make 4 requests 4 times a year)

A
Alexey Emelyanov, 2020-10-15
@babarun

  1. Write a function that calculates the SORT field for each product, based on its attributes, season, moon phase, mercury retrograde, distributors' purchase prices, etc. Some parameters increase the value, some decrease the SORT value, thereby pessimizing the position of the product in the list
  2. Hang it running on cron (for example, every night)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question