Configuring the Shopping cart totals web part

When you create the checkout process in your on-line store, the Kentico E-commerce Solution offers several possible options on how to display total prices or other total values of your shopping cart. All the possible options are available according to the settings of the Shopping cart totals web part. You can place more Shopping cart totals web parts on a page to combine them and achieve your desired appearance.

To add the Shopping cart totals web part to your checkout process and to configure the web part:

  1. Place the Shopping cart totals web part on your shopping cart page. If the Shopping cart totals web part is already on the page, open the configuration dialog.

  2. In Total to display, select your desired type of the shopping cart totals.

  3. If you selected Buy X Get Y and Order discounts summary, select Buy X Get Y transformation name.

  4. Click Save & Close.

The system now adds the Shopping cart totals web part or edits the existing web part and displays the total in the checkout process.

Types of shopping cart totals

In the Total to display field, you can select one of the following options:

  • Products total – total price of all products in the shopping cart without any order discounts. Discounts of the items and taxes are included.
  • Products excl. tax total – total price of all products in the shopping cart without any order discounts and without taxes. Discounts of the items are included.
  • Products tax total – total taxes of all products in the shopping cart.
  • Shipping total – total price of shipping, taxes are included.
  • Shipping excl. tax total – total price of shipping without taxes.
  • Shipping tax total – total taxes of shipping.
  • Buy X Get Y and Order discounts total – total saved price by the Buy X Get Y discounts and the order discounts.
  • Buy X Get Y and Order discounts summary – more complex total summary of the Buy X Get Y discounts and the order discounts using transformations.
  • Discounts total – total saved price by all available discounts.
  • Total – the final total price of the shopping cart, after including everything (discounts, taxes, etc.).
  • Tax total – total tax of items in the shopping cart and shipping.
  • Weight total – total weight of the items in the shopping cart.

If the total is a monetary value, i.e. the total is expressed in a currency, the currency is specified with theCurrency selectionweb part if available (otherwise, the main currency is used).

Buy X Get Y transformations for the Shopping cart totals web part

You can either choose the prepared transformation or you can create your own transformation. For example, to display how much a customer saved with a Buy X Get Y discount in the shopping cart:

  1. Place the Shopping cart totals web part on your shopping cart page. If the Shopping cart totals web part is already on the page, open the configuration dialog.

  2. To ensure that the web part with Buy X Get Y discount savings is visible only when a Buy X Get Y discount was applied to the shopping cart items, click Edit value ()at the Visible field and paste the following macro:

    
    
    
     {% ECommerceContext.CurrentShoppingCart.OrderRelatedDiscountSummaryItems.Any() %}
    
    
     
  3. In Total to display, select Buy X Get Y and Order discounts summary.

  4. Click Select at the Buy X Get Y transformation name field.

  5. Select the desired transformation. For example:

    • On the Dancing Goat sample site, select Page type in Class type, Checkout step (Ecommerce.CheckoutStep) in Page type and then select Ecommerce.CheckoutStep.CartDiscountSummary.
    • On the E-commerce site, select Page type in Class type, E-commerce site - Transformations (EcommerceSite.Transformations) in Page type and then select EcommerceSite.Transformations.OrderDiscountSummary.
  6. Click Save & Close.

The transformation displays the name of the discount and the amount saved.

Changing the transformation template

If you create a new transformation or edit an existing transformation, achieve your desired display using HTML code and macros. You can use the following properties:

  • Name – the name of the discount as specified in the Buy X Get Y discounts application.

  • Value – the amount saved after applying the discount. To format the value, you can use the following macro which formats the value into the format string of the currency:

    
    
    
      Value.Format(ECommerceContext.CurrentCurrency.CurrencyFormatString)
    
    
      

Transformation for Bux Y Get Y discounts