Manual sorting of collections doesn't work as expected
ID: 295245
Backlog
Published on 10/3/2017
•
Last update on 10/9/2024
Summary
Manual sorting of collections doesn't work as expected. There are two ways to sort SKUs using a collection:
- Using the ContentPlaceHolder control type collection;
- Using a search or search context of a Landing Page with the SearchResult control (in this case, the querystring O=productClusterOrder{ProductClusterId}%20asc_ must be used).
In both cases, the system supports sorting up to 30 SKUs of the collection. When the collection has more than 30 SKUs, all spare SKUs will be listed BEFORE those positioned between 1 and 30.
This behavior is observed in all VTEX stores, including those developed using VTEX IO.
Simulation
- Create a collection;
- Manually insert more than 30 SKUs;
- Save the collection;
- Create a template with ContentPlaceHolder or SearchResult;
- Set up the association of the ContentPlaceHolder with the collection or set the search in the folder search context;
- Wait a few minutes for the cache to expire;
- Access the page and note that the first ordered items will be items placed after 30.
Workaround
As a workaround, we have the following options:
- Use collections with only 30 items, if it's essential to apply manual sorting;
- Use the Release Date field, register the dates in the desired sequence, and use the field to sort the collection.