Discount Code
Create a Discount code in CommerceTools
This article explains how to view and create Discount codes in CommerceTools.
Contents
- Requirements
- Discount code list
- Connected cart discounts
- Creating a Discount Code
- General Info
- Condition
- Cart Discounts
- Times applied
Requirements
A discount code requires a cart discount with the option ‘Discount code is mandatory’ enabled to exist in CommerceTools before it can be made.
Typically, a cart discount is created especially for a code discount, but multiple discount codes may be associated with the same Cart discount.
Discount code list
To view all existing Discount codes, in CommerceTools navigate to the Discounts section in the left menu bar and select ‘Discount code list’.
A list of existing Discount codes is displayed on this page, and using the search bar and filters the displayed list can be refined.
Selecting a Discount code from the list will display all it’s configurations.
Here you will find for instance, along with the localized names and descriptions, you will see the specified ‘Max applications per customer’ setting.
Connected cart discounts
The connected Cart discounts, and their description are also found here
By selecting the top section in Cart discounts section, a drop down will appear, where additional cart discounts can be added to the discount code.
As well as being able to view the already connected Cart discounts, their ‘Status’ as well as their value.
Selecting one will redirect you to it’s own configuration page.
Its a good idea to review existing Discount codes and their connected cart discounts before creating a new one.
Creating a Discount Code
To create a Discount Code, there are two possibilities.
Navigate to the Discounts section in the left menu bar and select ‘Add a discount’
From here, select ‘Add discount code’
Or from the Discount code list, select the ‘+ Add discount code’ button
Either way you will be redirected to the discount code creation screen.
Technically Discount codes only have two mandatory fields, the code and the connected cart discounts. It is, however, best practice to also give the code a name, as well as localized names for each market which it is going be used in.
General Info
The name of a discount code should be brief but descriptive. By clicking Show all languages, you will be able to fill in the localized name. The Discount name is a searchable value and is the primary way to find one in the list view.
A description is what will be displayed to the customer in the cart when the code is used. By clicking ‘Show all languages’, you will be able to fill in the localized descriptions.
A Unique key to help identify the discount code can be filled in, but this is optional.
A date range can be entered to determine when the discount is valid from. The connected Cart discounts must also be valid, otherwise the code will not have any effect on the cart.
Max applications refer to the total number of times the discount code can be used, whereas Max applications per customer only limit the number of times a single customer can make use of the discount code. If a field is left empty the code is valid indefinitely.
A Discount Code can apply only once on the same Cart. A Discount Code application is counted every time an Order is created, and is not restored if the Order is cancelled.
In CommerceTools the discount code must be entered in uppercase. However, the code itself can be redeemed in any case form by a customer at the checkout, it is not case sensitive to an end user. The only further limitation is that a discount code cannot contain empty spaces, please use hyphens or underscores instead ( - or _ ).
Each Discount Code must be unique and cannot be updated after creation.
Groups can be understood as searchable tags or keywords. A discount code can be assigned multiple groups.
Groups are case-sensitive, a search term must be an exact match in order give a result. In turn on the main Discount code list, the searchable field can be toggled to Discount group and any assigned groups can be used to find the discount code.
Condition
Typically, the Condition field of a discount code can be left empty as it is the rules and logic of the connected Cart discount that is used. However, it is possible to create extra conditions that apply only to the code.
The condition field uses a specific syntax that determines its behaviour. This is essentially the same syntax used by Cart and Product discounts, and what is generated by the rule builder. However, only Cart and Product discounts have the rule builder.
Writing the condition syntax from scratch is not advised. In the scenario where a discount code must have additional conditions that are not in the connected cart discount, it is best practice to create the logic in the rule builder and copy the generated code back to the condition field.
Here you see a rule and logic that is from a tier discount
By selecting the < > icon the syntax from that code is generated
This syntax can then be copied back to the condition field of the discount code.
But even one wrong character or space will invalidate the syntax, in which case you will be prompted with the following error.
Cart Discounts
Cart Discounts must be manually linked to discount code, use the searchable dropdown to select any existing Cart Discount with code as mandatory toggled will be visible.
A maximum of 10 Cart Discounts can be added. The Cart Discount with the higher rank (closer to 1) takes precedence.
The status and value of selected cart discounts will be displayed under the dropdown field.
Once all mandatory fields have been filled a discount code can be saved.
Newly created Discount Codes are inactive and not applicable in the Cart. They must manually be activated on the discount code list page
Select the inactive discount code in the list.
and via the actions drop down click activate.
CommerceTools Discount Code activation article
Times applied
To view how many times a discount has been used, navigate to the discount code list view page via the side menu bar.
There open the column manager by selecting the table settings icon on the right side of the page.
On the left side of the column manager the hidden columns are displayed
Drag ‘Times applied’ to the visible columns section.
And then you will see the numerical value of the times that the discount code has been used.
Further Reading
Discount Overview
Create a cart discount
Create a product discount
Tier Discounts
Create a product