Explore Sorting Rule Strategies
Learning Objectives
After completing this unit, you’ll be able to:
- Describe common sorting rule strategies you can use for sale, new arrivals, and top sellers sorting results.
- Explain how dynamic attributes work.
- Explain how to use manual sorting rules to optimize the sort order on the catalog and search results pages.
- Explain how product attributes can help you customize your search results.
- State how the Storefront Toolkit helps with dynamic sorting.
Make a Plan
Brandon Wilson explored how sorting rules work in the last unit. Now he wants to develop a strategy that connects shoppers with the products they want to buy, while maximizing his company’s return on investment. He focuses on these result types.
- New Arrivals: Sell exciting new products
- Top Sellers: Highlight what other shoppers like the most
- Search: Show shoppers what they want to see
- Items On Sale: Encourage shoppers to consider end-of-season merchandise
Here are his goals and sorting rule plans.
Result Type |
Goal |
Sorting Rule Plan (in attribute order) |
New Arrivals |
Control the top 1 to 2 rows of a results grid, followed by new arrivals |
|
Top Sellers |
Place top sellers at the top of the page. |
|
Search |
Boost products that are most relevant to the shopper’s search term |
|
Items On Sale |
Sort products in the Sales category by SKU coverage, Sales velocity, and best sellers |
|
To meet these requirements, he takes a look at:
- Manual sorting rules
- Product attributes in sorting rules
- Dynamic attributes
In this module, we assume you are a Salesforce B2C Commerce merchandiser with the proper permissions to perform these tasks. If you’re not a B2C Commerce merchandiser, that’s OK. Read along to learn how your merchandiser would take these steps in a staging instance. Don’t try to follow our steps in your Trailhead Playground because B2C Commerce isn’t available in the Trailhead Playground.
If you have a development instance of B2C Commerce, you can try out these steps in your instance. If you don’t have a development instance, ask your manager if there is one that you can use.
Manual Sorting Rules
Manual attributes include category position, search placement, and search rank. Only after they are activated manually in Business Manager can they be used in a sorting rule.
Category Position
Brandon uses this attribute in a sorting rule to make sure products within a certain category sort exactly the way he wants. To create this sorting rule, he needs to do two things.
- Assign a category position to products within a category.
- Create a sorting rule that uses the category position attribute.
For example, he wants B2C Commerce to sort men’s shorts in a certain order. So, he assigns the order position to these products manually in the Business Manager. Then he adds the category position attribute to a sorting rule. Here’s how to assign the sort order position.
- Open Business Manager.
- Click site > Merchant Tools > Products and Catalogs > Catalogs.
- Select your catalog and a category:
mens
- Select sub-categories:
mens-clothing and mens-clothing-shorts
- Enter numbers (integers) into the Position column to order the products.
Brandon adds the category position attribute to a sorting rule, along with another attribute to accommodate keyword search results. (He creates sorting rules in the next unit.)
Search Placement
For some products, assigning a category position is too specific, and category position only works with categories. With search placement, Brandon can do these things.
- Group certain products together.
- Promote or demote certain products.
- Ensure certain products appear next to each other.
- Sort subcategories in a particular order within a main category.
He can assign search placement codes that rank products from high to low, using the values in Business Manager or creating his own. Here are the values in Business Manager.
- NONE—This is the default value.
- 8 (Top Featured Product)
- 7 (Featured Product)
- 6 (Product)
- 5 (Secondary Product)
- 4 (Featured Accessory)
- 3 (Accessory)
- 2 (Spare Part)
- 1 (NLA Product)
Brandon uses search placement for the relevance of a particular product within a category. For example, within the womens category, he wants shoes to appear first in search results, and tights last. He must assign a search placement code to each subcategory within the womens category. Otherwise, the products he wants to list between shoes and tights will have a null value and display below the tights.
Here’s how to select a search placement value for one subcategory.
- Open Business Manager.
- Click site > Merchant Tools > Products and Catalogs > Catalogs.
- Select your catalog and then the womens category.
- Click Edit to the right of the shoes category.
- Click the Category Attributes tab.
- For Search Placement, select the placement value:
8 (Top Featured Product)
All products in this category are assigned this value, unless a different value is selected for a subcategory or the product itself.
Brandon creates a sorting rule to include the new product attribute. (He creates sorting rules in the next unit.) He can also assign a search placement value to an individual product.
Search Rank
To promote a group of products, Brandon can explicitly set the search rank of a group of products to these.
- 3 (High)
- 2 (Medium)
- 1 (Low)
Brandon wants to phase out seasonal women’s tops. Here’s how he gives them a search rank of high
to move them to the top.
- Open Business Manager.
- Click site > Merchant Tools > Products and Catalogs > Catalogs.
- Click your main catalog ID.
- Click Edit to the right of the womens-tops category.
- Click the Category Attributes tab.
All products in this category are assigned this value, unless you assign a different value for a subcategory or the product itself.
(To set it for the product, click site > Merchant Tools > Products and Catalogs > Products > product.) - Scroll down to the Search Rank section.
- Select the search rank: 3 (High)
- Click Apply.
Make sure you include the search rank product attribute in a sorting rule. While you can add search rank to a dynamic attribute, don’t do this because the value resolves to zero.
Product Attributes
Brandon can use the B2C Commerce product system object attributes in a sorting rule or create custom attributes. Product attributes define product details, such as product ID, title, small description, size, and so on.
Brandon creates a custom product attribute called isSale to push sales items to the bottom of the search results. Here’s how he creates the attribute.
- Open Business Manager.
- Click Administration > Site Development > System Object Types.
- On the System Object Type List page, click the name of the object you want to edit:
Product
- Click the Attribute Definitions tab.
- Enter
isSale
into the ID or Name field and click Find.- If it’s there, you’re all set. You can skip to creating the sorting rule.
- If it’s not there, click New.
- Enter the following information:
- Enter a unique ID for the attribute:
isSale
- Enter a display name:
On sale?
- Value Type:
Boolean
- Enter a unique ID for the attribute:
- Click Apply. You can now use this attribute in a sorting rule. (In the next unit, Brandon uses this attribute to create a sorting rule.)
The product object has a new attribute, but it’s not populated across the database. Brandon can populate the new attribute manually or through a bulk update or a product feed. Here’s how to add the new attribute as a field on the Business Manager product page General tab.
- Open Business Manager.
- Click Administration > Site Development > System Object Types.
- On the System Object Type List page, click Product.
- Click the Attribute Grouping tab.
- Click Edit for the Business Manager display group:
Search Refinements
- Click the gray ellipses, then locate and select isSale. You can now populate isSale data in Business Manager.
Dynamic Attributes
Dynamic attributes contain multiple active data attributes, each providing a percentage of the whole, or a weighted value. B2C Commerce uses them to make near real-time sort adjustments based on site activity and sales, for both category and keyword search. For example, Brandon wants to sort search results by a combination of revenue, units, look to book ratio, and availability, each with a weight of 25%. He can change the weighting whenever he wants, and test one scenario against another with B2C Commerce A/B Testing.
Null Values
A null value means that B2C Commerce calculated null for a product’s value. For standard attributes and single active data attributes, products with null values display at the bottom of the results set, regardless of the configured direction. For dynamic attributes, you can set a default for null value handling, as follows.
Default |
How it Sorts Null Values |
Goal |
Minimum |
End of the result set. |
|
Average |
Middle of the result set. |
|
Maximum |
Beginning of the result set. |
|
Next Steps
In this unit, you explored common sorting rule strategies and learned how to configure manual sorting rules, create dynamic attributes, and use product system object attributes. Next, you learn how to configure sorting rules.