Best practices

Learn about some of the general best practices when using Product Discounts.

  • After completing this page, you should be able to:

    • Apply best practices associated with Product Discount to common promotion scenarios.
  • Prioritize Product Discounts over Cart Discounts

    Product Discounts are stored on the Price record of a Product Variant, which has some consequences to keep in mind:

    • Product Discounts can never be applied after a Cart Discount. A Product Discount already exists on the Price record of a Product Variant before it is added to a Cart as a Line Item. Cart Discounts are only applied after a Line Item is added.

    • Considering the fact that Cart Discounts are recalculated every time a change occurs to a Cart, it is better to implement a discount as a Product Discount rather than a Cart Discount, whenever possible. The only exception to this is when using Discount Codes, which are applied directly to the Cart and require less processing.

    Use Product Discounts in combination with Prices

    With Composable Commerce, you have the flexibility to choose how you want to approach your promotion strategy needs that best suits your business case.

    Not only do you also have the possibility to create up to 100 Embedded Prices or 50 000 Standalone Prices for each Product Variant, and establish these Prices based on dimensions such as Channels, countries, Customer Groups, and validity dates, but you can also create Product Discounts which are built on similar dimensions.

    For example, you could create a base price for a new mobile phone for Customers in the United States who belong to your Platinum Customer Group. Using Product Discounts, you can offer a discounted price to the exact same combination of dimensions (United States and Platinum Customer Group). This provides a lot of flexibility in being able to utilize the pricing and discount data in your UI and makes for smooth reporting analytics as well.

    Simplify Discount Predicates

    To select the correct Products, some promotions might require you to use many Predicates such as using dozens of OR conditions (IN) to select more than 30 Products by Product ID, SKU, or any other attribute that only accounts for a few products. This can make the Predicates very large, hard to manage and cause the Product or Cart discount payload to be large.

    One of the ways to simplify a Predicate is to use Categories or Attributes to group the promotion Products:

    • Categories: Create a Category branch for the promotions group and map the Products to the relevant promotion Category using the API, Merchant Center, or ImpEx. To flag that it is being used for this purpose, use a namespace or a Custom Type on the Category. This helps you determine if these Categories should be displayed on the front-end or synced to a third-party system, and allow you to map the whole Product and its Product Variants to the Category.

    • Product Attributes: Create a Product Attribute of type Set Enum or localized Set Enum with its values as the names of the promotions. We have considered a Set type so that Products can belong to multiple promotions. When selecting the Attribute, you must consider if its constraints should be Same for all or None. This helps determine if you can define the item as being part of the promotion at the Product or Variant level. You can then map the Products to the relevant promotion Product Attribute using the API, Merchant Center, or ImpEx.

    Now when you create the Discount Predicates, you can use the Category or Product Attribute in your discount rules.

    Rank Discounts

    Both Product Discounts and Cart Discounts use ranking. Over time, a Project can have many Product Discounts and Cart Discounts, and as mentioned earlier, ranking is important to decide which discounts apply in which order. If you do not plan ahead with a structured strategy for creating rank values, you might face these challenges before long:

    • Difficulty in understanding which discount has a higher or lower priority.
    • Running out of rank values of increasing or decreasing priority. For example, if your last discount had a rank value of 0.9999 and you want to introduce an overlapping discount campaign that runs concurrently, you might not have further values to use. Although, a quick short-term solution is to create a new rank value of 0.99999, using it can easily become messy and more difficult to understand in the long run.

    Our recommended strategy is to have your first Discounts use four decimal points starting in the middle of a possible range between 0 and 1, such as 0.5000. In this way, you constantly have room to add discounts and maintain an orderly system of discounts. As you add further discount strategies, each new Discount should increment up and down by the fourth decimal place. For example, the next highest priority Discount will be 0.5001 and the lowest priority discount will be 0.4999.

    View Discounts by their rank value

    We strongly recommend adding the Rank column on both the Product Discount list and Cart Discount list pages. This is very useful to view and sort the Discounts in your Project based on the ranking.

    To view the column, click Table settings > Column manager and drag the Rank from Hidden columns to Visible columns.

    Rank column on the Product Discount list page.

    Test your knowledge