Example - Adding a product with a Text option
The example demonstrates how you can add a product with a Text option to a Kentico site. The product is based on the Product - Book product type, and has one product option.
The example uses the sample E-commerce Site.
Adding a new product
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 Books -> Technical in the product sections tree and click New ().
- The system opens a dialog allowing you to specify the required type of your new product.
Select Product - Book in the Product types column.
- 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 Configuring product page types.
Enter the following values for the product’s properties:
- Product name: Developing Websites with Kentico
- Price: 19.99
- Department: Books
- Image: upload an image file
- Representing: Standard product
- Allow for sale: Yes (checked)
- Available items: 10
Click Save.
The system adds the product to the selected part of your on-line store. Now you can add to the product a product option category.
Adding a product option category to the product
Switch to the product’s Options -> Option categories tab and click New category.
- Alternatively, you can add to the product an existing category by clicking Add categories.
Enter the following values for the category’s properties:
Option category name: Book inscription
The system uses this name in your on-line store administration interface.
Display name: Inscription
The system uses this name on the live site.
Enabled: Yes (checked)
Type: Text
Click Save.
Enter the following values for the category’s properties in the Options and Validation sections:
- User control type: Text field
- Display price adjustment: Yes (checked)
- Maximal text length: 50
Click Save and close the dialog.
If you now switch back to the product’s Options -> Option categories tab, the system lists the product option category as assigned to the product. As an option category of type Text, the category automatically contains one option, which you can now modify.
Configuring the product option
- Edit () the Book inscription product option category and switch to its Options tab.
- Enter the following value for the option’s Price adjustment property: 5.
- Click .
If your customers purchase the product together with the product option, they will have to pay an extra charge.
Reviewing the product on the live site
Open the live site.
Select Books -> Technical in your on-line store main menu.
- The system displays a list of all technical books that you offer in your on-line store.
Click Developing Websites with Kentico to view the product’s details page.
Enter My inscription into the Inscription field.
Click Add to cart.
The system adds the product together with the product option to the shopping cart.