This document is mainly addressed to developers who want to make use of the product sorting feature. Products can be sorted manually and automatically by a sorting attribute and sorting direction - ascending and descending.
The sorting of products within a category on a category landing page can be configured in the Commerce Management application.
If a Solr search index has been built then this index will be used to get the products. In this case the configuration includes one more aspect, the Predefined product filters.
It will be described in the section Using Solr Search Index.
In case no search index is used then the products are directly restored from the database with the sorting configured in the Commerce Management application.
If a Solr search index is used, then Predefined product filters have to be configured to ensure the correct product order.
A predefined product filter can be assigned to a category page:
Products can be assigned automatically to a category via so called dynamic product-category assignment. This approach uses the Solr search index and a predefined product filter to select the products which are to be assigned to this category.
The predefined product filters can be configured in Catalogs | Predefined Product Filters.
For every filter you can select a category and up to 10 filter conditions, weightings and sortings. Only attributes indexed by Solr are selectable for sorting such as Manufacturer, Color, Size and etc. Every indexed attribute has a property indicating that it is sortable. This is configurable in the details page of the attribute in the search index configuration. In order to have these attributes selectable when configuring the predefined product filter, the corresponding search index has to be consistent (up-to-date, initially built).
To manage dynamic product-category assignments:
Navigate to the category level at which you want to work.
Click Edit in the row of the category you intend to edit.
On the General tab go to the Product Assignment section and select Assign Products dynamically.
In each section, edit the rules as required.
The following options are available:
Category
Specifies the catalog category to which the product filter search operation is restricted. Clicking Select opens a wizard for selecting the intended category. Clicking Clear removes the category restriction.
Filter Condition
Specifies the text values (for text attributes) or value ranges (for numeric attributes) intended to be retrieved by the filter. Up to 10 filter conditions can be created in this section.
Sorting
Specifies the sorting of the retrieved result set. The sorting attribute is independent of the defined filter condition. Up to 10 sortings can be created in this section.
Weighting
Specifies a weighting for specific attribute values. Up to 10 weightings can be created in this section.
If no Predefined Product Filter is selected for the Category Page or the selected filter provides no sorting then the sorting settings are used by default. This can be done in the Commerce Management application (described in next section Using Pre-Defined Sorting / Arrangement in Commerce Management Application).
If there is any sorting then this will overrule every other sorting configuration.
Without Solr search index the products are directly sorted as configured in the Commerce Management application.
There are three different places to configure the sorting of products:
The standard sorting attributes include Product Name, Product ID, List Price and Manufacturer Name. In addition, any custom attribute can be selected.
If a sorting attribute has been defined, products are sorted in ascending or descending order, depending on their attribute value. In case not all products have the attribute defined which determines the sorting, the list elements (products) without a value for the sorting attribute are listed after the list elements that can be sorted.
There are different product relations. This section describes the possible sorting capabilities.
Sorting of variations is done in the Commerce Management application in the Variations tab of a product master.
There are two ways to sort variation products:
The sorting of bundled products is done in the Commerce Management application in the Bundles tab of a product bundle.
In this case only manual sorting is supported. Use the checkboxes on the page and the "Move Up" or "Move Down" arrows to position the bundled products.
The sorting of parts of retail set products is done in the Commerce Management application in the Retail Set tab of a product retail set.
In this case only manual sorting is supported. Use the checkboxes on the page and the "Move Up" or "Move Down" arrows to position the parts of a retail set.
Sorting of product links is done in the Commerce Management application in the Links tab of a product.
In this case only manual sorting is supported. Use the checkboxes on the page and the "Move Up" or "Move Down" arrows to position the product links.