The commercetools platform supports three types of discounts:
- Product discounts: apply a discount to a specific product or subset of products.
- Cart discounts: apply a discount to all products in a targeted cart or a subset of products in a targeted cart.
- Discount codes: apply a discount to a customer’s cart or a subset of products in the cart when the customer inputs a unique code.
Product and cart discounts apply in two ways:
- Relative value: a percentage-based discount, for example, 20% all handbags.
- Absolute value: an absolute value discount, for example, $10 off the total of a cart.
The commercetools platform supports a maximum of 200 active discounts for any project.
Discount stacking and ranking
Product and cart discounts have a Rank field which takes a value from 0 to 1.00, with as many decimal points as needed. This field determines the order to apply discounts. The closer the decimal is to 1.00, the higher the rank. The highest ranked active discount for a product or cart is the discount which applies.
Rank determines which discounts apply in the following way:
- Product discounts: only the highest ranked product discount applies.
- Cart discounts: all active and applicable cart discounts apply in sequence from the highest ranked discount to the lowest ranked discount.
- Discount codes do not have a Rank field.
How discounts apply
Discounts apply in the following order:
- Product discounts apply before a product is added to the cart – they are a part of the Product Variant’s product information, and are stored as a discounted price. Product discounts are useful for displaying discounted or sale prices on a product information page.
- Cart discounts apply, in ranked order.
- Discount codes apply.