---
title: Example - Adding a product with variants
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The example demonstrates how you can add a product with variants to a Kentico site. The product is based on the _Product - Cup_ product type, and has six product options in two _Attribute_ option categories. Only five of these options are available for the product. The product has four variants. Two variants have their prices different from the price of the product.

The example uses the sample _E-commerce Site_.

## Adding a new product

First, you need to add a new product of the required [type](https://docs.kentico.com/k8/e-commerce-features/configuring-and-managing-your-store/products/managing-product-types-and-product-section-types.md) and [representation](https://docs.kentico.com/k8/e-commerce-features/configuring-and-managing-your-store/products/managing-product-representations.md) to a selected part of your on-line store.

1. Open the **Products** application.
2. Select **Gifts -> Cups** in the product sections tree and click **New** ().

   - The system opens a dialog allowing you to specify the required type of your new product.
3. Click **Product -** **Cup** in the **Product types** column.

   ![Selecting a product type](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/selecting_product_type.png "Selecting a product type")

   - The system opens a page where you can specify product properties.
   - Alternatively, you can select some other product type, e.g. **Product**.
   - If the system doesn't offer any product type (for example, if you deleted the default product types), create a new product type as described in [Managing product types and product section types](https://docs.kentico.com/k8/e-commerce-features/configuring-and-managing-your-store/products/managing-product-types-and-product-section-types.md).
4. Enter the following values for the product's properties:

   - **Product name**: Kentico Cup
   - **Price**: 9.99
   - **Department**: Gifts
   - **Image**: upload an image file
   - **Representing**: Standard product
   - **Allow for sale**: Yes (checked)
   - **Track inventory**: By variants
5. Click **Save**.

The system adds the product to the selected part of your on-line store. Now you can add product option categories to the product.

## Adding product option categories to the product

Add to the product two product option categories of the Attribute type.

1. Switch to the product's **Options -> Option categories** tab and click **New category**.               

   - Alternatively, you can add to the product existing categories by clicking **Add categories**.
2. Enter the following values for the category's properties:

   - **Option category name**: Color of cup

     > **Info:** The system uses this name in your on-line store administration interface.
   - **Display name**: Color

     > **Info:** The system uses this name on the live site.
   - **Enabled**: Yes (checked)
   - **Type**: Attribute
3. Click **Save**.
4. Enter the following values for the category's properties in the **Options** section:

   - **User control type**: Radio buttons in vertical layout
   - **Default text**: None (empty)
5. Click **Save** and close the dialog.
6. Click **New category** (on the **Options -> Option categories** tab).
7. Enter the following values for the category's properties:              

   - **Option category name**: Size of cup
   - **Display name**: Size
   - **Enabled**: Yes (checked)
   - **Type**: Attribute
8. Click **Save**.

   - **User control type**: Radio buttons in horizontal layout
   - **Default text**: None (empty)
9. Click **Save** and close the dialog.

The system adds to the product two empty product option categories. Now you can add product options to the categories.

![Available product option categories](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/available_option_categories.png "Available product option categories")

## Adding product options to the categories

Add three product options to the _Color of cup_ category, representing the red, green and blue color of the cup.

1. **Edit** () the _Color of cup_ category and switch to the **Options** tab.
2. Click **New option**.
3. Enter the following values for the first option's properties:

   - **Option name**: Red
   - **Allow for sale**: Yes (checked)
4. Click **Save and create another**.
5. Enter the following values for the second option's properties:

   - **Option name**: Green
   - **Allow for sale**: Yes (checked)
6. Click **Save and create another**.
7. Enter the following values for the third option's properties:

   - **Option name**: Blue
   - **Allow for sale**: Yes (checked)
8. Click **Save** and close the dialog.

Add three product options to the _Size of cup_ category, representing the small, medium-sized and large cup.

1. **Edit** () the _Size of cup_ category and switch to the **Options** tab.
2. Click **New option**.
3. Enter the following values for the first option's properties:

   - **Option name**: Small
   - **Allow for sale**: Yes (checked)
4. Click **Save and create another**.
5. Enter the following values for the second option's properties:

   - **Option name**: Medium
   - **Allow for sale**: Yes (checked)
6. Click **Save and create another**.
7. Enter the following values for the third option's properties:

   - **Option name**: Large
   - **Allow for sale**: Yes (checked)
8. Click **Save** and close the dialog.

The system adds to each option category three product options. Now you can specify which of these options the system is to offer to your store administrators while defining product variants.

## Selecting available options

> **Info:** Selecting available options while defining product variants is optional.
>
> If you allow all options, you can later allow only selected variants made from these options (when defined).

Currently, all the six options are available for the product. However, you want your customers to be able to buy the Kentico Cup in blue or red color only. This means that you need to disallow the _Green_ option.

1. Click **Select available options** () for the **Color of cup (Color)** option category.

   ![Launching the Select available options action for the Color of cup (Color) option category](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/launching_select_options_action.png "Launching the Select available options action for the Color of cup (Color) option category")

   - The system opens the **Select available 'Color of cup (Color)' options** dialog. Here you can specify which options from this option category are available to your on-line store users.
2. Select **Allow only selected options**.
3. Enable the **Red** and **Blue** options.

   ![Selecting available options](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/selecting_available_options.png "Selecting available options")
4. Click **Save & Close**.

The system indicates that only two options from the _**Color of cup (Color)**_ option category are available to your on-line store users. Now you can add variants to the product using the available options.

![Available options](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/available_options.png "Available options")

## Adding the variants

1. Switch to the product's **Options -> Variants** tab.
2. Click **Define available variants**.
3. Select the following option categories:

   - **Color**
   - **Size**
   - The system offers combinations of available options from the two option categories as variants of the product.
4. Select the following variants:

   - **Red-Small**
   - **Blue-Small**
   - **Blue-Medium**
   - **Blue-Large**

     ![Defining product variants](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/defining_product_variants.png "Defining product variants")
5. Click **Save**.

If you switch back to the product's **Options -> Variants** tab, you can see that the product has four available variants.

![Available variants](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/available_variants.png "Available variants")

On creating the variants, the system automatically assigned each variant its name and SKU number. The system also set the price of each variant according to the price of the product.

Now you can modify the variants' properties.

## Configuring the variants

> **Info:** Configuring the variants is optional.
>
> Configure the variants if you want to change the variants' properties, for example the price.

1. Set the value of the **Price** property of the _**Kentico Cup (Blue, Large)**_ variant to _14.99_.

   ![Changing the price of the variant](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/changing_variant_price.png "Changing the price of the variant")
2. Click .
3. Set the value of the **Price** property of the _**Kentico Cup (Blue, Medium)**_ variant to _11.99_.
4. Click .
5. For each variant, specify also the **Stock** property: _10_.

If your customers purchase the large or medium-sized Kentico Cup, they will be charged accordingly.

## Reviewing the product on the live site

1. Open the live site.
2. Select **Gifts **->** Cups** in your on-line store main menu.

   - The system displays a list of all cups that you offer in your on-line store.
3. Click **Kentico Cup** to view the product's details page.

   - The system offers the cup in red and blue color in three different sizes. The unavailable combinations of product options are greyed.

     ![Viewing the product details page](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/viewing_product_details_page.png "Viewing the product details page")
4. Select the large cup in blue color.
5. Click **Add to cart**.

The system adds the product (product variant) to the shopping cart.

![Viewing the shopping cart content](https://docs.kentico.com/docsassets/k8/example-adding-a-product-with-variants/viewing_shopping_cart_content.png "Viewing the shopping cart content")
