The commercetools Merchant Center offers a system for creating and customizing different types of commercetools promotions, including discounts, coupons, and special offers. We are going to discuss the facts and nuances of commercetools product discounts, cart discounts, and coupon codes. Let’s get saving!
Product Discounts vs. Cart Discounts
There are two types of discounts: product discounts and cart discounts. Their name indicates where the discount is applied. Product discounts are applied on the product page while cart discounts are applied on the cart page. It is important to note that product discounts only apply to products whereas cart discounts can apply to products, the entire order, and shipping.
Product Discounts
With all objects in commercetools, you have standard fields such as ID, Date Created, Date Modified, Version, and others. We’re not going to use all of those in our discussion here. We’re focusing on the fields specific to product discounts and what they do.
Value
The value represents the savings and how it’s applied. All amounts are applied to a product variant or SKU price. Relevant Discounts take a percentage off, whereas Absolute Discounts take a specific amount off such as $10. External Discounts are applied directly to the price. They can be different for each price based on whatever rules you’re using. These can be from an external promotion engine, spreadsheet upload, custom business rules, or some other mechanism that specifies the discount you want on a specific price.
Predicate
The predicate is how the system determines which items should get the discount. In the Merchant Center UI, this is labeled as the Eligibility Criteria. The API expects a string that follows a specific pattern to match product data to values. It has multiple statements that can be combined with AND/OR operators to make complex matching rules. In this simple example, we’re matching the product ID to its corresponding GUID. However, you can use any of the product data to do these matchings. You can combine multiple matching rules.
Sort Order
Sort order determines priority. There is no stacking in product discounts. Therefore, the highest priority discount is applied. All other product discounts that could apply to that SKU are ignored.
Cart Discounts
Cart discounts are often the more interesting of the two types of discounts. As discussed earlier, cart discounts are savings a customer will only see on the cart page. These are typically applied after the cart is created and has a few items in it. It can also be applied after shipping is selected.
Value
Just like product discounts, cart discounts also have a Value. Relative, Absolute, and Eternal Discounts work mostly the same way. However, another option exists for cart discounts called Fixed Price. This sets specific items in the cart to a predetermined value. This means that regardless of the original price of the item, the discount will override that price and make it exactly what you set that predetermined value for. In our example, it’s $10.
Predicate
Cart discounts also have a predicate. However, instead of matching discounts to products, they match discounts to carts. The cart discount predicate is extremely powerful. It allows you to target any value stored in the cart, even custom attributes configured for that project. They also include functions that allow for things like totaling values or leveraging subtotals. Similar to product discount predicates, multiple statements can be combined into complex rules. This predicate determines if that cart qualifies for this cart discount.
Target
While the predicate determines if the cart qualifies for a specific discount, the target determines what should be discounted. You can select line items, the order total, the shipping cost, or build BOGO (buy one, get one) commercetools promotions with the multi-buy line items.
Sort Order
Sort order works a bit differently for cart discounts. Stacking is allowed, so the sort order determines which discounts should be applied first. This has a big impact on stacking. It can also impact the final price; if you apply a percentage off before a dollar amount, you can end up with a greater discount than if you apply a dollar amount off before a percentage off. This is something important to consider when setting your Sort Order.
Stacking Mode
The stacking mode helps in determining which discounts can be used together. There are two values: “Default” and “Stop After This Discount.” These work in conjunction with the sort order. The default will keep applying cart discounts based on their sort order. However, the minute it hits a cart discount that says “Stop After This Discount,” it will stop processing, and any cart discounts with a lower sort order will be completely ignored.
Requires Code
“Requires Code” is unique to cart discounts. The default is “False.” This means the cart discount auto-applies the minute the specific conditions are met. Once that cart meets all the criteria of that predicate, commercetools automatically adds it to the cart and the customer sees the discount in their cart.
If you choose to mark this as “True”, the customer will need to add a coupon code to the cart before they can see the savings.
Discount Codes
Coupon codes or discount codes are the last pieces of the puzzle. These are the codes a customer will enter during checkout that apply their corresponding cart discounts. The most important thing you need to determine is the code itself. It is a string that must be unique. Because these strings are case-sensitive, you may want to limit the code to specific characters or choose to make them all upper or lowercase to avoid confusion. Aries Solutions can help set up these rules during implementations or add them to your current solution.
Discount codes point to specific cart discounts. In the API, this is represented as an array of references. In the Merchant Center, it just looks like a list. You may be asking, “Why would one discount point to multiple cart discounts? Why would one code have multiple discounts attached?” The answer is that it allows a wide variety of possible discounts and promotions your business can run. The example below is a spend-more-save-more type promotion. Here, a single coupon code can point to each threshold, which are set up as different cart discounts in the Merchant Center. Having this one-to-many relationship opens up the type of commercetools promotions you can offer.
Codes also have a cart predicate. This is separate from the one that’s on the cart discount. They both must meet the criteria before you can have the discount applied. commercetools first checks the cart predicate on the discount code, sees if the code can be applied, and then checks the predicates on all the discounts that code points to and sees if those can be applied as well.
Coupon codes also let you set how many times it may be used. Max Applications is the total number of uses. Think of it like a doorbuster promotion where the first one hundred customers get the discount. Max Application per Customer states how many times each customer can use the code. This is tied to the commercetools customer endpoint and authentication in order to better keep track of each customer’s coupon code usage.
commercetools Promotion Questions?
If you prefer the vlog version of this article, be sure to check it out on our YouTube page! Give us a follow for more helpful content and click here to read up on our other commercetools promotions articles including:
Creating a Cart Discount in commercetools
How to Create a Buy More Save More Promotion in commercetools