Module: Commerce content modeling

35 of 38 Pages

Explore commerce content modeling in Training guides

This overview walks through the product catalog implementation used in the Training guides repository. It covers content modeling decisions, reusable field schemas for building product and variant content types, and the key features of the commerce implementation — including stock tracking, catalog discounts, product listing and detail widgets, and automatic page wrapper management.

Before you start

This guide requires the following:

Code samples

This guide highlights functionality from the finished branch of the Training guides repository, alongside other training materials.

The main branch of the repository provides a starting point to code along with our other guides.

Note that the finished branch uses .NET 8 and implicit using directives. You may need to adjust the code slightly to use it in your project.

Terminology

Before we start, let’s establish a few terms for different product types that we will use throughout this overview.

Product variants - distinct versions of a given product based on attributes such as size and color, that merit a distinct entity.

For example, if a jacket comes in multiple colors and sizes, a shop would likely track stock for each individual combination, like small black jacket, small gray jacket, medium black jacket, etc.

Parent products - products which have variants. Parent products are often abstract, providing info that is shared among their variants and representing the relationship between variants, but they cannot be directly purchased or stocked.

For example, a shop might sell multiple quantities of the same canned energy drink with 6-pack box and 24-pack box variants. The variants are tied together by a parent product called Super Energy that contains branding, nutritional information, and a description.

Basic products - products which do not have variants. Basic products are top-level products like parent products, but they are not abstract. They directly represent something that can be purchased.

For example, a shop might sell a coffee mug with the company logo on it. This product requires stock tracking and price information even though it is a top-level product with no parent.