Create a Cart Discount
This article explains how to create Cart Discounts in CommerceTools.
Contents
- Cart Discount Overview
- Discount Code Link
- Create a Cart Discount
- Rank (sort Order)
- Discount effects
- Cart conditions
- Examples
- Duplicating a discount
Cart Discount Overview
In CommerceTools all existing Cart Discounts can be viewed in a list overview. Before creating a new Cart Discount, it may be a good idea to view similar existing Cart Discounts.
Cart Discount List
To view all existing Cart Discounts, navigate to the left menu bar to the Discounts section, and select ‘Cart discount list’.
Sort the list by selecting the column headers.
Refine the list of displayed cart discounts by either entering a search term.
Or by applying one or more filters, by clicking the ‘Filters’ button
Selecting a discount from the list will display it’s properties and specific configuration.
When creating a new discount, it is a good idea to compare it with existing discounts, especially ones it might be combined with. Keeping in mind that the Rank (sortOrder) field value determines the hierarchy and combinability of discounts.
It is furthermore a good idea to use a similar discount as an example, some specific configurations can be quite complex.
Discount Code Link
A Discount Code must be linked to a Cart Discount, and the Cart Discount must be created first. Discount codes have a separate list in the discounts tab in CommerceTools. But they are inherently linked to the associated Cart Discount. It’s important to understand this relationship. See Create a Discount Code.
Create a Cart Discount
There are two ways to create a Cart discount, via the Add Discount button on the respective list view pages.
Or via the left menu bar
Navigating via the menu bar will first open the discount type selection.
But after selecting ‘Add Cart Discount’ the same creation screen will be displayed.
Cart Discount Type
This is where you can choose between a numeric discount or a gift-line item. In this article we only discuss numeric (relative (%) or absolute) discounts.
General Information
Name
A Cart Discount must have at least one name in on of the available languages
But you may choose to fill in the names for other languages by clicking ‘show all languages’. Discount names should be descriptive and clear as it is the primary way that discounts can be searched for in CommerceTools.
Description
The description is how the discount is displayed to the customer in the shopping cart on the webshop.
This is a non-mandatory field and just like the name field you may choose to fill in the names for other languages by clicking ‘show all languages’.
Key
This is unique identifier which is a way that discounts can be searched for in CommerceTools. When left empty, the key is set automatically after saving.
Store
Using the store field you can specify if the cart discount will be limited to a subset of stores, as indicated, leaving this field empty will make the cart discount valid for all stores in the tenant.
The stores that you have already added will be displayed and removed in the section directly under the field.
Recurring Intervals
This feature is not supported - Always leave this field on the default selection Since a release of a new version of CommerceTools Merchant Center in January 2026, a selection field has been added where a Recurring interval can be selected. It should however remain on the default selection as this feature is not supported
Rank (sort Order)
In CommerceTools, to ensure that various types of discounts function
correctly with each other and to determine the precedence of one discount over another, the value of the field ‘Rank (sortOrder)’ is used.
The value of this field determines the order, sorting and stacking of various discounts.
Range 1.0 - 0.900
This range is for discounts that should take precedence over all others, typically those that you do not want to stack. Therefore, make sure to check the 'do not stack' option. This ensures that the discount applied will be the only one. For instance, a code with a large relative discount will fall into this category. Additionally, tier discounts will not be applied concurrently with this discount.
Range 0.899 - 0.8
This range is reserved for tier discounts. Tier discounts need to be in a relatively high sort order because if they are placed under another discount, the relative discount will be incorrect. For example, if a 5% discount is applied first, a subsequent 10% tier discount will be calculated on the already reduced price, leading to an incorrect 10% discount on the original price.
Range 0.799 – 0.0
This range is designated for discounts that can be stacked under tier discounts. For instance, a 5% cart volume discount that is applied when the cart reaches a certain value. The rationale for placing this discount under tier discounts is to prevent it from affecting the price of the tier discounts, and to ensure that tier discounts are calculated before applying volume discounts. These discounts can be stacked regularly.
Discount rank value logic
The rank for the cart discount determines which cart discount applies to your product first if the customer's cart has multiple cart discounts applied. Discounts with a rank value closer to 1 are considered first. Rank values can only be a value between 0 > 1. For example:
- Cart discount 1 has a Rank value: 0.07
- Cart discount 2 has a Rank value: 0.05
- Both cart discounts are active and apply to the same cart. Cart discount 1 will apply before Cart discount 2 is applied.
Stacking options
Currently in CommerceTools we only use one type of stacking option; Do not apply any further cart discounts after this one.
When this option is enabled all discounts with a lower rank order value will not be applied. So, for this option to work for the discount you are creating it must be the highest value of any other applicable cart discounts it will be used in combination with.
However, this option does not interfere with product discounts. Product
discounts and cart discounts can be executed simultaneously, but the product discount always precedes the cart discount in order.
Discount Code
Toggle whether a code is required to use the cart discount.
Valid Date
By specifying a date range you can limit the validity of the cart discount.
If left empty the discount is valid indefinitely.
Discount configuration
There are two main parts of the discount configuration: the effects and the conditions. Both parts are mandatory and must be configured before being able to save the cart discount.
Discount effects
There are five types of effects to choose from.
Total Price
Discount applies to the total price of the order. If taxes are included in the price and/or shipping, the discount is calculated after taxes.
Item
This discount applies to a Line Item, which represents products or services that are defined in the product catalogue. First you must determine if the discount should apply to specific items or all items.
When applying the discount to specific items a configuration section will appear on the screen. There are several types of rule logic that can be used to specify which items the discount will be valid for.
Then you must appoint which items will be used by the rule’s logic. CommerceTools refers to the items as ‘Predicates’. By default, you will be creating a rule based on product ID, but by clicking the blue area you can toggle which property you search and add items to the rule’s criteria.
You may search for an item/predicate or scroll down the list and select one.
With each selected item/predicate you can further determine operator logic to apply to the value entered in its respective field.
Operator Logic Explanation
| Operator | Syntax | Meaning |
|---|---|---|
| Is | == |
Exact value match, e.g. used for specifying a specific product. |
| Is not | =/= |
Exact value exclusion, e.g. used for excluding specific products. |
| Is less than | < |
Applies to values lower than what is entered. (only applies to numeric values) |
| Is less than or equal to | =< |
Applies to values lower than or equal to what is entered. (only applies to numeric values) |
| Is greater than | > |
The condition applies to values greater than what is entered. (only applies to numeric values) |
| Is greater than or equal to | => |
Applies to values greater than or equal to what is entered. (only applies to numeric values) |
| Is one of | =={a,b,c,...} |
Value matches a set, e.g. used for specifying a set of products. |
| Is not one of | =/={a,b,c,...} |
Value is not part of the set, e.g. used for excluding a set of products. |
| Has a value | =/= null |
The specified field has any value. |
| Does not have a value | == null |
The specified field is empty. |
These fields are however not searchable. You will need to collect this data beforehand or use the product list in a sperate tab/window. You can add multiple criteria, using different selection predicates and different logic operators
You can add any number of different criteria. It is also possible to create the eligibility criteria via syntax, by enabling the < > option in the editing options.
Please do not use this unless you are familiar with the syntax, see the CommerceTools discount documentation. This is an example of what this syntax looks like.
Then you must specify what type of discount should be applied
Percentage off - enter a numerical value that determines the percentage discount applied to the total cart. Amount off - enter a numerical value that determines a discount applied to the total cart. Fixed price - enter a numerical value that determines the price of the total cart.
Buy and Get
This discount type will be triggered by a specific number of specifiable products to trigger a configurable discount. By default, you will be creating rules based on Product ID, but by clicking the blue area you can toggle which item/predicate you are using.
You may search for an item/predicate or scroll down the list and select one.
This type of discount can be configured to a set of any number of items/products or variants, by selecting the + Line item Criteria button you can specify additional criteria which in turn can use different .
Or simply any item/product.
Then specify on which amount of the items/products the discount should be applied to.
Or simply specify which amount for all items/products.
Next toggle to which of the items/products the discount will be applied to.
Using the slider determine whether the discount can repeat in the cart, if active it can be specified to a set amount or unlimited.
Then determine the percentage, buy and get type cart discounts can only use percentage-based discount values.
Discount Bundles
This type is a simpler amount-based discount, compared to Buy and get, you cannot target which products the discount is applied on, only which products trigger it and the amount.
You can choose an amount of specific items/products
Or simply the amount of any products.
Next toggle to which of the items/products the discount will be applied to.
Using the slider determine whether the discount can repeat in the cart, if active it can be specified to a set amount or unlimited.
Then determine the type and value of the discount that will be applied.
Percentage off - enter a numerical value that determines the percentage discount applied to the total cart.
Amount off - enter a numerical value that determines a discount applied to the total cart. Fixed price - enter a numerical value that determines the price of the total cart.
Shipping
As the name suggests, this discount type is used exclusively for discounts on shipping costs.
You can determine a percentage or fixed amount
To make shipping free enter 100 with percentage off selected.
Cart conditions
After configuring one of the available cart discount effect types, you must then determine what type of cart the discount will be applied to. You can apply the discount to a specific type of cart, which can be determined by configuring any number of criteria rules.
Using the where logic specification drop down configure the failure
conditions...
By default, you will be creating a rule based on Cart Total, but by clicking the blue area you can toggle which property you search and add items to the rule’s criteria.
You may search for an item/predicate or scroll down the list and select one.
You may also apply a discount to all carts.
After you have made all the desired configuration you must press the save button, from this point on the discount will be available to be selected and connected to a Discount Code.
Examples
Total Price -Threshold discount
This type of cart discount requires a minimal cart value, this can include or exclude shipping, require a code or any number of further conditions. Here is an example of such a discount, it has a minimum cart value,
including shipping costs and requires a code
Item -Product based discount
This type of cart discount requires specific products or variants to be in the cart to be valid. It is a common discount used in conjunction with promotions. Here is an example of such a discount, it is percentage based and is only valid for the specified product variant.
Item - Category based discount
This type of discount is commonly used in campaigns; they target a product category. Here is an example of such a discount, it is percentage based and is only valid for products in the cart that are from the specified category, as well as having further restrictions.
Shipping-free shipping
These discounts are used to give customers free shipping. Typically based on cart value but can be configured in any number of ways. Here is an example of such a discount that is configured to a specific campaign.
Duplicating a discount
If you have a complex discount setup that you want to re-use, for instance with a slight variation, or maybe linked to a different category. You can use the duplicate button in the top-right of an existing discount page to make a copy.
After clicking on the duplicate button, you will be redirected to the discount creation screen with all the fields and values from the source discount,
besides:
The Cart discount name, which is appended by “Copy”.
The Rank (sortOrder), which displays the source value, but must be entered manually.
The rest of the rules, logic and field values will be copied.
Related articles and further reading
- Discount overview: Discounts
- Create a Product Discount: Create a Product Discount
- Create a Discount Code: Create a Discount Code
- CommerceTools comprehensive discount documentation: https://docs.commercetools.com/merchant-center/discounts-overview
- CommerceTools Cart Discount documentation: https://docs.commercetools.com/api/projects/cartDiscounts
- CommerceTools Discount Predicates: https://docs.commercetools.com/api/predicates/predicate-operators
- CommerceTools Carts and Orders overview: https://docs.commercetools.com/api/carts-orders-overview#line-items-and-custom-line-items