Customizing the Commerce Search Results rendering
The Commerce Search Results rendering variant includes an additional renderer in the form of a Scriban template. Scriban templates are available as renderers similar to, for example, field renderers, sections, or tags and can coexist with other renderers. Scriban templates can contain sophisticated logic that cannot be expressed using other renderers and can greatly reduce the complexity of rendering variants by including numerous renderers in one template. You can also use them to replace existing rendering variants.
General documentation about the underlying templating language and the built-in functions is available on the Scriban GitHub repository.

The Scriban template is responsible for rendering the markup for the individual product cards. It is executed within a loop in the corresponding MVC View 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.
For a demo of how to modify a Scriban template, see the Sitecore Experience Commerce video on the Discover Sitecore channel.
The following code shows the Commerce Search Results rendering Scriban template defined within the default rendering variant.
You can customize the following Commerce Search Results rendering Items. 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.
The following table details the key properties of the Commerce Search Results Scriban template.
- Property: Type
- i_item: Item
- displayName: Variable
- title: Attribute
- productImage: Variable
- Responsive Image: Responsive Image
- sc_translate: Embedded Function
- i_item.brand: Property