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.
First, you need to add a new product of the required type and representation to a selected part of your on-line store.
Open the Products application.
Select Gifts -> Cups in the product sections tree and click New ().
Click Product - Cup in the Product types column.
Enter the following values for the product's properties:
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.
Add to the product two product option categories of the Attribute type.
Switch to the product's Options -> Option categories tab and click New category.
Enter the following values for the category's properties:
Option category name: Color of cup
The system uses this name in your on-line store administration interface.
Display name: Color
The system uses this name on the live site.
Enabled: Yes (selected)
Type: Attribute
Click Save.
Enter the following values for the category's properties in the Options section:
Click Save and close the dialog.
Click New category (on the Options -> Option categories tab).
Enter the following values for the category's properties:
Click Save.
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.
Add three product options to the Color of cup category, representing the red, green and blue color of the cup.
Edit () the Color of cup category and switch to the Options tab.
Click New option.
Enter the following values for the first option's properties:
Click Save and create another.
Enter the following values for the second option's properties:
Click Save and create another.
Enter the following values for the third option's properties:
Click Save and close the dialog.
Add three product options to the Size of cup category, representing the small, medium-sized and large cup.
Edit () the Size of cup category and switch to the Options tab.
Click New option.
Enter the following values for the first option's properties:
Click Save and create another.
Enter the following values for the second option's properties:
Click Save and create another.
Enter the following values for the third option's properties:
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 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.
Click Select available options () for the Color of cup (Color) option category.
Select Allow only selected options.
Enable the Red and Blue options.
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.
Switch to the product's Option categories -> Variants tab.
Click Define available variants.
Select the following option categories:
Select the following variants:
Click Save.
On the product's Option categories -> Variants tab, you can see that the product has four available variants.
On creating the variants, the system automatically assigned each variant its name and SKU (product 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 is optional.
Configure the variants if you want to change the variants' properties, for example the price.
Set the value of the Price property of the Kentico Cup (Blue, Large) variant to 14.99.
Click .
Set the value of the Price property of the Kentico Cup (Blue, Medium) variant to 11.99.
Click .
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.
Open the live site.
Select Gifts -> Cups in your on-line store main menu.
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.
Select the large cup in blue color.
Click Add to cart.
The system adds the product (product variant) to the shopping cart.