Create Sorting Rules
Learning Objectives
After completing this unit, you’ll be able to:
- Configure a sorting rule using single attributes.
- Preview a category sorting rule.
- Configure a hybrid sorting rule.
- Configure a storefront sorting option using a dynamic attribute.
Create Sorting Rules
Brandon Wilson, Cloud Kicks merchandiser, is ready to create his sorting rules. He wants to start small and then strive for more granularity as his confidence grows. Here are the sorting rules he wants to configure.
- A sorting rule with a single attribute
- A hybrid sorting rule
- A storefront sorting option with a dynamic attributes
Once he’s finished, he can preview his results.
Create a Sorting Rule with a Single Attribute
Brandon wants to order search results based on the availability of items, and thinks the availability ranking attribute might be a good choice. But that attribute only groups the affected products and pushes them to the end of the search result list. It doesn’t sort the products by descending availability.
To use availability ranking in a sorting rule, he must first do these things.
- Enable or disable dynamic ranking based on availability.
- Set an availability threshold that determines if a product is pushed to the end or to the beginning of the search results. (Business Manager: site > Search > Search Preferences.)
Availability ranking isn’t the only product inventory related attribute. Which attribute Brandon chooses depends on how he manages the inventory and products on his site. Here’s how he can decide.
Goal |
Attribute to Use |
Attribute Type |
Keep out-of-stock products online. |
Availability Rank |
Standard Attribute |
Configure base products with multiple variations that have varying stock across the range of sizes/colors/materials. |
SKU Coverage |
Availability Model |
Boost products that have a lot of units left. |
ATS |
Availability Model |
Boost products with a good range of stock across all variations. |
Combine ATS and SKU Coverage in a dynamic attribute |
Availability Model |
Boost slow-sellers. |
Sales Velocity or Time To Out Of Stack (TTOS) |
Active Data |
Brandon decides to use the available to sell (ATS) attribute to boost high-inventory products in his Sales category to the top of the search results. His sorting rule uses ATS
first (from highest to lowest) and then revenue
to break ties. For any products with the same score, the rule displays the ones with higher revenue first.
Here’s how to create this sorting rule.
- Open Business Manager.
- Click site > Merchant Tools > Search > Sorting Rules.
- Click New.
The page has three sections: Sorting Rules, Attributes, and Preview. - Enter a unique rule ID and description:
cloudkicks-01
- Click Add in the Attributes section.
- From the dropdown, scroll to the section you want, and select:
- ATS
- Revenue (30 Days) (activeData.revenueMonth)
- Click Apply.
- Keep the Text Relevancy settings to No for both attributes.
Selecting Yes means that the text relevance score (from 0 through 1) is multiplied by the score of the attribute you use for the rule. This is the equivalent of a 50%-50% weighting between the selected attribute and the text relevance score. Use this when multiple items might have the same score from the sorting attribute, such as a recommendations sort, or when sorting for best-selling items. - In the Direction column, leave both attributes Descending.
Preview Sorting Rules
Here’s how Brandon previews the sorting rule.
- Open Business Manager.
- Click site > Merchant Tools > Search > Sorting Rules.
- Select the sorting rule you just created: cloudkicks-01
- In the Preview section, select Sale from the category list.
- Enter a search term:
shorts
- Click Preview.
Products appear based on the search term. If no products meet the specific attribute requirements, you still see products in the preview category that have the search term in the product name.
You can use the Storefront Toolkit to examine search results. The tool shows the sorting rule used to determine search results, the sorting criteria within the rule, and the sorting criteria values for each search result.
Create a Hybrid Sorting Rule
Brandon wants to configure a hybrid sorting rule that’s a combination of category position and a custom product attribute called isSale
to push sales items to the bottom of the search results. He created this attribute in the previous unit, and now creates a new sorting rule to use it. Also, he doesn’t want to end his sorting rule in a tie, so he adds a dynamic rule to avoid it. Here’s how he does it.
- Open Business Manager.
- Click site > Merchant Tools > Search > Sorting Rules.
- Click New.
- Enter a unique rule ID and description:
cloudkicks-03-hybrid
- Click Add in the Attributes section and select from the dropdown:
- Standard attribute: Category Position
- Product attribute: On sale?
- Active data attribute: Views
- Click Apply.
- Keep the Text Relevancy settings to No for all attributes.
- In the Direction column, leave them set to
Ascending
andDescending
, respectively. - Click Apply.
Create a Storefront Sorting Option with a Dynamic Attribute
Brandon wants to configure a new storefront option for the dropdown that shows a combination of new arrivals and bestsellers. To do this, his storefront option must use a sorting rule that consists of a dynamic attribute. This means that he must do the following.
- Create a dynamic attribute.
- Create a sorting rule that uses the dynamic attribute.
- Create a storefront option that uses the sorting rule.
He wants his new dynamic attribute, called hotItems
, to blend sales velocity (descending, average, 60% weighting) and Views (ascending, minimum, 40% weighting). B2C Commerce calculates the sales velocity and days available, with the search results now showing a blend of both.
Here’s how Brandon creates the dynamic attribute.
- Open Business Manager.
- Click site > Merchant Tools > Search > Sorting Rules.
- Click Dynamic Attribute.
- Click New.
- Enter a unique attribute ID and description:
hotItems
- Click Add in the Attributes section.
- Select active data attributes from the drop down:
- Sales Velocity (30 Days)
- View
- Select the settings for each attribute:
-
Descending, Average,
60
% weighting -
Ascending, Minimum,
40
% weighting
-
Descending, Average,
- Click Apply.
Here’s how Brandon creates the sorting rule.
- Open Business Manager.
- Click site > Merchant Tools > Search > Sorting Rules.
- Click New.
- Enter a unique rule ID and description:
cloudkicks-02-dynamic
- Click Add in the Attributes section.
- Select the dynamic attribute from the dropdown:
hotItems
- Click Apply.
- Set Text Relevancy (No) and Direction (Descending). If you set text relevancy to Yes, B2C Commerce multiples the sorting attribute score by the text relevancy score.
Here’s how Brandon uses the sorting rule in his new storefront sorting option.
- Open Business Manager.
- Click site > Merchant Tools > Search > Storefront Sorting Options.
- Click New.
- Keep the site language: Default
When you select a new language to configure, the values for the Display Name clear for that language. If you don't have sites in different languages, select Default or the locale for the current site. - Enter a unique ID:
cloud-kicks-topsellers
This ID is used internally by B2C Commerce. - Enter a Display Name:
Holiday Top Picks
This is the name that displays in the storefront. - Select a sorting rule from the dropdown: cloudkicks-02-dynamic
- Click Apply.
- Click <<Back to List.
- Select cloud-kicks-topsellers.
- Click the sorting arrow to make this option a priority.
- Click Apply.
The new rule displays at the top of the list and at the top of the storefront option dropdown.
Let’s Wrap It Up
In this unit, you created a sorting rule with a single attribute, a storefront sorting option with a dynamic attribute, and a hybrid sorting rule. Now take the final quiz and earn a new badge.