Using rendering variants to display product information
The Commerce renderings for SXA include a Product Information rendering that is used to show the product title and description on the product details page. An alternative method to display this information is to use variants of standard SXA renderings.
Rendering variants installed with SXA Storefront
When you install SXA Storefront, SXA rendering variants are installed in the /sitecore/Content/Sitecore/Storefront/Presentation/Rendering Variants folder. An additional commerce-specific rendering variant is available for the Page Content rendering that enables you to display a name, description and other product fields with a single SXA component. This provides you with an alternative to the Product Information rendering that is available in the Commerce Catalog section of the Experience Editor Toolbox.
You can use the SXA renderings Rich Text and Title with catalog items as well. To do so, create a custom rendering variant that allows you to display, for example, a product description or display name. You need to create a custom rendering variant because catalog items use field names that are different than those used in the default rendering variants.
The data source for the renderings
The storefront uses a single page to display different products. The CatalogItemResolver
pipeline processor sets the current product context.
To enable you to use product item fields in SXA rendering variants, the ResolveCatalogContext
pipeline processor dynamically sets the data source for these renderings to the current product, based on the following conditions:
-
The rendering is one of the following: Page Content, Rich Text, or Title.
-
The product context is set.
-
The data source for the rendering is not already set in the control properties.