Distinct attributes to manage product variants
When searching for items without a context filter (for example, a context of a specific store location), you may see duplicated items with the same ID, as every product will be displayed for every context.
This feature allows you to create distinct attributes that always provide unique results.
In this case, we will be looking at a t-shirt that is available in different colours. We want the colour ranges available on the product detail page, but we only want one result (the most relevant) to be returned when searching. To do so, we will make the 'colour' tag distinct:
- Navigate to Search - Search index mapping.
- Locate the attribute that you would like to be distinct.
- If it does not have the Distinctable tag, click on "Edit properties" and select Distinctable from the menu.
Defining the attribute:
- Navigate to Search - Configuration list - Configuration.
- Click 'Variants manager' under the Configuration tab.
- Choose to make this feature always active or defined by a rule by clicking on either box.
- If defining a rule, click 'Manage activation rule,' which will allow you to add conditions.
- Click Apply when you have configured the rules.
- Click Create.
Sorting by dynamic attributes
Dynamic attributes allow you to score the activities you are tracking on an item, for example, the number of items bought in the last 15 days. View How to create a dynamic attribute? for more information.
To sort by dynamic attributes gives greater flexibility and control over how customers view items in your catalog. It is now simple to sort by bestselling or popular items, which are ever-changing.
- Navigate to Search - Configuration list - Configuration.
- Under the Configuration tab, click 'Sortable attributes'.
- Click 'Add sortable attributes' and select one from the 'Dynamic attributes' section, then click 'Add attributes'.
- To see this in practice, click on the Browse tab and search for an item. Choose the new sorting option from the dropdown menu, either by ascending or descending.
Note: These items will not have an item score, as it is calculated when there is no sorting option active.
Custom rankings
Custom scoring allows products to be sorted and weighted according to specific criteria and business requirements. The score can utilise dynamic attributes for greater flexibility.
A custom ranking applies a custom score based on specific criteria. A common example is ranking by bestselling items on the product listing page.
We will use a custom score based on a bestselling dynamic attribute for this example. For more information on creating this, view How to create your custom scoring?
Apply the custom score:
- Navigate to Search - Configuration list - Configuration.
- Under the Configuration tab, click 'Custom ranking'.
- Click 'Add custom ranking' and select the BestSelling custom score from the dropdown list.
Next, we must add conditions, so the ranking isn't applied to every product. We want it to only apply on a product listing page.
- Click 'Add condition' and select the facet category. Select 'exists' from the following dropdown.
- Add another condition. This time we want the search query to be equal to *, meaning when the search query is empty.
- Leave the operator as 'AND' as it must satisfy both conditions before updating the ranking.
- Click Create to successfully create your first custom ranking.
Comments
0 comments
Please sign in to leave a comment.