Sitecore Experience Commerce

The Shopping Cart service layer


Learn about the shopping cart service layer, engagement plan and rendering rule conditions.

The Commerce Connect core framework contains a number of abstract service layers. The Shopping Cart service layer is one of the most important service layers.

This topic describes:

The following table describes the operations contained in the Shopping Cart service layer.

Type of operation


Create, Read, Update, Delete (CRUD), and merge operations on a cart


DeleteCart* – not necessary to call if the cart turns into an order


SaveCart – typically not necessary to call explicitly as it is done indirectly by calling UpdateCart or updating cart lines


GetCarts – supports multiple carts per customer


CRUD operations on cart lines




CRUD operations on associated parties, for example, address and contact information




Add and remove operations on associated shipping information



Add and remove operations on associated payment information



Locking and unlocking cart




All operations marked with an asterisk (*) trigger a unique page event that allows the contact interaction to be carefully tracked, making it possible to report and act on these operations. Most of the events include information about the cart ID and the added products. The page events are installed when you install Commerce Connect.

The following illustrates basic shopping cart user-case scenarios:


Typical storefront usage of the shopping cart API is as follows:

  • When the contact first arrives at the webshop, the CreateOrResumeCart method is called to retrieve the cart and to show the cart content and total in a mini-cart.

  • If the contact has previously registered a profile and left a cart from previous visits, then the MergeCart method is called when the contact logs in.

  • As the contact starts to add products to the shopping cart, the AddCartLines method is called.

  • During the checkout process:

    • Shipping and billing addresses are added using the AddParties method.

    • Shipping information specifying method and referring to lines and parties is added using the AddShippingInfo method.

    • Payment information specifying method and referring to lines is added using the AddPaymentInfo method.

  • While processing the payment information and reserving money on credit cards, the cart is locked using the LockCart method.

For more detailed information, see the Commerce Connect Developer's Guide.

Commerce Connect includes three rendering rule conditions that can be used to personalize the contact experience based on the products in the cart, the cart total, and the quantity of products. The cart data is read live from the external commerce system, not from the marketing platform. The conditions can be combined in a rule in a number of different ways. For example:

  • Contains product: If [shopping cart contains product A] then …

  • Cart total: If [shopping cart total is > Y] then …

  • Item quantity: If [shopping cart total quantity of items > N] then …

  • A combination of the above: If [shopping cart contains more than N quantity of product A and cart total > Y] then …

Commerce Connect 9.0.2 contains a default Storefront Abandoned Cart marketing automation campaign that lets you track shopping carts and send emails to contacts when they abandon their cart.