Digital commerce setup

Advanced license required

Features described on this page require the Xperience by Kentico Advanced license tier.

The digital commerce feature helps you build simple online stores where you can sell physical or digital products. It gives you the basic tools, data structure, and actions you need to manage your shop and process orders. You can use it to set up product listings, handle purchases, and store customer data. Custom development is needed to fully set up and customize your shop, but this feature takes care of the main building blocks so you don’t have to start from scratch.

To use the commerce features of Xperience by Kentico:

  1. Enable and configure the commerce feature.
  2. Prepare a product catalog and fill it with products.
    • You need to implement stock management to track product availability. You can do this by modeling the product stock as a custom module.
  3. Implement shipping and payment methods.
  4. Implement the shopping cart and checkout process.
  5. Configure order statuses and set up notifications for order status changes.
  6. Display the product catalog and shopping cart on your website.
    • Depending on your product catalog model, you can either directly display product pages (if using pages to store products) or create pages for each product using custom code (if using the content hub to store products).
    • The shopping cart and checkout interfaces need to be implemented as custom pages or widgets.

Enable digital commerce

To enable the commerce feature:

  1. Open your Xperience project in Visual Studio and edit the Program.cs file.

  2. Enable the commerce feature in the application startup:

    C#
    Program.cs
    
     using Kentico.Xperience.Commerce;
    
     ...
    
     WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
    
     ...
    
     builder.Services.AddKentico(features =>
     {
         // Enables digital commerce
         features.UseCommerce();
     });
     

Configure commerce features

Configure shopping cart

You can configure the expiration time of shopping carts. The value is used as the expiration time of the shopping cart cookie as well as the time after which any shopping cart is deleted. The default value is 1 day.

Note: The scheduled task that deletes shopping carts older than the specified value is executed once per day. Using values of less than 1 day has no effect.

To configure the shopping cart:

  1. Open your Xperience project in Visual Studio and edit the Program.cs file.
  2. Configure ShoppingCartOptions and set the available properties, such as Expiration.
C#
Program.cs

using Kentico.Xperience.Commerce;

...

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

...

builder.Services.Configure<ShoppingCartOptions>(
    // Sets the expiration time of shopping carts
    options => options.Expiration = TimeSpan.FromDays(30)
    );