Customizing the Commerce Search Results rendering
The Commerce Search Results rendering variant includes a renderer in the form of a Scriban template.
The Scriban template is responsible for rendering the markup for the individual product cards. It is executed within a loop that iterates over the product items. To change the markup generated for the product cards, you can modify the Scriban template. It is best to create a new custom rendering variant in this case so that the customization does not get overridden during software upgrades. You can also modify the labels for the rendering.

The following table details key properties of the Commerce Search Results rendering Scriban template.
|
Property or Variable |
Description |
|---|---|
|
The In the default implementation, it is assumed that items are all of type | |
|
The | |
|
|
The displayName variable is used in various contexts. For example, it is initialized to It is also assigned to the |
|
The image link is retrieved using the | |
|
This function is used to display items defined in the Dictionary Domain of the site (sitecore/Content/<tenant>/<site>/Storefront Dictionary). | |
|
|
This property stores the brand name of the product and is displayed in the |
The following code shows the Commerce Search Results rendering Scriban template defined within the default rendering variant.
The Commerce Search Results rendering is a clone of the SXA Search Results rendering specific to Commerce. It has its own default rendering variant root and default rendering variant (/sitecore/Content/<tenant>/<site>/Presentation/Rendering Variants/Commerce Search Results), which uses a Scriban template for generating the markup, JavaScript for retrieving the stock and price information (as an AJAX request), and the SXA Dictionary for label translation.
You can change the labels used with the Commerce Search Results rendering.
Product Summary View model
Product Summary View model
When search results are processed, the price and stock information is retrieved from the Commerce Engine and converted to the ProductSummaryViewModel model to be rendered inside Scriban template (accessed through the o_model variable).
