Loading...
Area: Episerver Commerce
Applies to versions: 10 and higher
Other versions:

Commerce rendering templates

This topic describes how to render catalog content in Episerver Commerce. 

Defining content types

To display products and other catalog information in the implementation, the Episerver Content system is used. Content types are used to control the way different catalog entities are rendered. The following example shows a simple content type for a product variant.

For information about defining content types, see Catalog content.

Defining rendering templates

You can display Commerce catalog content on your website by creating a rendering template (MVC/WebForms) in the same way you would for CMS content (see Rendering). The following example shows a simple controller for a product variant.

For the currentPage and currentContent properties, because the catalog is routed as a partial route to the CMS route, the currentPage gives you the PageData that the route is registered under. Default for that is the start page of the site. However, for Commerce content, currentContent is the requested catalog content.

For information about templating, see Rendering.

Registering routing

To use a renderer template, you need to register the catalog content routes. The recommended way is to do it is in an EPiServer.Framework.IInitializableModule using the CatalogRouteHelper. See Routing.

Last updated: Oct 24, 2016