Skip to content
Operator handbook
Schedule Discounts
Commercetools
Commercetools

Schedule Discounts

This article explains how to schedule discounts in commercetools so they start and stop on their own. The main use is a temporary campaign, such as a weekend promotion, that replaces the standing tier discounts for a few days and hands back to them afterwards without anyone switching discounts on or off at midnight.

Read Tier Discounts first. This article assumes you know how a tier discount category and its cart discounts are set up.

How scheduling works

Every cart discount and product discount has a Valid from and a Valid until field, each a date and a time. On a cart discount they sit on the General tab, below Discount code. See Create a Cart Discount and Create a Product Discount.

  • Valid from empty: the discount is valid as soon as it is active.
  • Valid until empty: the discount never expires.
  • Both filled: the discount is only valid between the two dates.

Valid from and Valid until

A discount must also be switched on with the Status toggle at the top right of the discount, showing activated. The toggle and the dates work together: a deactivated discount is never used, whatever its dates say, and an activated discount outside its dates is not used either. For a scheduled campaign, set the dates and set Status to activated straight away. Do not wait for the start date to activate it. An activated discount counts toward the commercetools limit on active cart discounts without a code from the moment it is activated, even before its start date; see Discounts.

Status toggle and duplicate icon

Merchant Center shows and takes these dates in the time zone set under My Profile > Personal Settings > Time Zone, and in the date format of Language and region on the same page. If no time zone is selected there, it uses the time zone of your computer. The store's own time zone plays no part, so when a campaign must start at midnight in a country in another time zone, convert the time before you enter it.

The shop respects the dates for every discount it displays: tier discounts, threshold bar discounts (threshold…), product offers (product-offer…), confirmation offers (confirmation-offer…), and fortune-wheel discounts (fortune-wheel…). A cart discount outside its dates is not shown on a freshly loaded product page or buy box, and it drops out of a cart the next time that cart is updated. Product discounts follow their dates too, but commercetools applies those itself and can take longer to start or stop them; see the product discount timing below.

When a scheduled change shows on the shop

commercetools recalculates the discounts of a cart whenever the cart is updated, for example when a product is added or removed, and the shop updates the cart when the order is placed. So an order is always placed with the cart discounts that are valid at that moment. A cart that sits untouched keeps showing its previous discounts until its next update.

The product page caches prices and tiers for a few minutes, which gives the following timing for tier discounts:

Change Product page Cart
A tier discount ends Disappears on time on a fresh page load At the next cart update
A tier discount starts Can take up to about 10 minutes to appear At the next cart update

Around a start or an end, the product page and the cart can briefly show different prices, in either direction. A customer who already has a product page open keeps seeing the old tiers until the page reloads, and an untouched cart keeps its old discounts until it is updated. The order itself is always placed with the cart discounts that are valid at that moment.

The product page can only take a tier down on time when it already knows the end date. Set Valid from and Valid until at least 10 minutes before they take effect. An end date set to a moment only a few minutes away can keep showing on the product page for up to about 5 minutes after it has passed.

The Google Shopping feed does not follow this timing. It takes tier prices from the product data, which can be up to a day old, and only changes when the feed is generated again. Expect the feed to show the previous tiers for up to a day, or longer until the next feed run, after a campaign starts or ends.

Product discounts are slower. commercetools updates the discounted prices of products in the background, which according to commercetools can take between a fraction of a second and several hours depending on how many products and prices the discount affects. A product discount on a handful of products is usually quick; one on a large category can lag. Schedule large product-discount campaigns with a margin and check a few products once the start time has passed.

Rules for scheduled tier discounts

Never let two tier discounts overlap

The product page shows one row per starting quantity, the lowest quantity in the tier's condition. When two valid tier discounts for the same product start at the same quantity, it shows only the one with the highest Rank (sortOrder). Two tier discounts that start at different quantities but both cover a quantity, such as 2 or 3 and 3 or more, show as separate rows.

commercetools does not work that way at checkout. Tier discounts use the stacking option that allows further discounts, so both discounts are applied to the cart line, one on top of the other. A product page showing 5% for 2 units can then charge 5% plus 15% in the cart.

So for any product, at any moment, only one tier discount may be valid per quantity. This applies across tier categories too: a product in two tier discount categories must not have tiers for the same quantity in both at the same time. Use the valid dates to make campaigns take turns, as in the examples below.

If an overlap does happen and the higher-ranked discount ends, the product page shows the next one down for that quantity straight away. That keeps the page close to what the cart charges, but it does not make an overlap correct: until the higher one ended, the cart was stacking both.

One set of dates per discount

A discount has a single Valid from and a single Valid until. It cannot pause and resume. To take a standing tier discount off for a campaign and bring it back afterwards, split it into two copies: one that ends when the campaign starts, and one that starts when the campaign ends. Use the duplicate icon next to the Status toggle, see Discounts.

Each copy needs its own Cart discount key starting with tier-discount and its own Rank (sortOrder), as commercetools does not allow two cart discounts with the same rank. Keep the same conditions, category and percentage on both copies.

Line the dates up exactly

Leave no gap and no overlap between the end of one discount and the start of the next. Set Valid until of the ending discount to exactly the same moment as Valid from of the starting one, for example Saturday 00:00 on both. A discount stops being valid at its valid until moment and the next one starts at that same moment, so matching values hand over cleanly.

Rank

Keep scheduled tier discounts in the tier range of Rank (sortOrder), above the cart discounts that should stack on top of tiers such as volume discounts. See Discounts. Because scheduled tiers never overlap, their ranks relative to each other do not decide anything; they only need to be unique.

Product discounts switch tiers off

The tier discount conditions contain Price - Discount ID cannot have a value. So while a product discount is valid on a product, its tier discounts do not apply, on the product page or in the cart. When the product discount ends, the tiers apply again automatically. A scheduled product discount is therefore a way to replace all tiers of a product for a period without touching the tier discounts at all, keeping in mind the product-discount delay described above.

Examples

These examples use a standing tier discount category with three tiers:

Tier Quantity Discount Valid
Tier 1 2 or 3 5% always
Tier 2 4 or 5 10% always
Tier 3 6 or more 15% always

Weekend tier campaign

The weekend tiers replace the standing tiers from Saturday 00:00 until Monday 00:00, and the standing tiers come back on Monday by themselves.

  1. Split the standing tiers. For each standing tier discount, set Valid until to Saturday 00:00. Then duplicate it, give the copy its own key (for example tier-discount-tier-discounts-2-3-from-monday) and rank, and set its Valid from to Monday 00:00 with Valid until empty. Activate the copies.
  2. Create the weekend tiers. Create a cart discount per weekend tier with the same configuration as the standing tiers (same tier discount category, quantity conditions and Price - Discount ID and Personal offer key conditions), a key that marks the campaign (for example tier-discount-weekend-2-3) and the campaign percentage. Set Valid from to Saturday 00:00 and Valid until to Monday 00:00. Activate them.
  3. Check the schedule. In the cart discount list, open Table settings (the column icon above the list), choose Column manager and drag Rank, Valid from and Valid until to Visible columns. Sort on Discount key to group the tier discounts, then compare the dates: for every quantity exactly one discount is valid at each moment. Search in the list only finds an exact name or key, so sorting is the quickest way to see a set of tiers together.

Cart discount list with tier discounts
Column manager with Valid from and Valid until

The result:

Discount Quantity Discount Valid from Valid until
Tier 1 (standing) 2 or 3 5% Sat 00:00
Tier 2 (standing) 4 or 5 10% Sat 00:00
Tier 3 (standing) 6 or more 15% Sat 00:00
Weekend Tier 1 2 or 3 15% Sat 00:00 Mon 00:00
Weekend Tier 2 4 or 5 20% Sat 00:00 Mon 00:00
Weekend Tier 3 6 or more 25% Sat 00:00 Mon 00:00
Tier 1 (from Monday) 2 or 3 5% Mon 00:00
Tier 2 (from Monday) 4 or 5 10% Mon 00:00
Tier 3 (from Monday) 6 or more 15% Mon 00:00

After the campaign, deactivate or delete the ended standing tiers and weekend tiers, so they stop counting toward the limit on active cart discounts. The copies from Monday are now the standing tiers.

Every weekend tier covers the same quantities as the tier it replaces. If the campaign uses different quantity steps, for example 3 or more instead of 2 or 3, end every standing tier that shares a quantity with a campaign tier, not only the ones with the same name.

Quantity pricing on a single product for a week

Tier discounts belong to a category, so dates alone cannot give one product different tiers while the rest of its category keeps the standing tiers. Splitting the standing tiers would end them for every product in the category. This setup needs the product moved between categories by hand, at the start and at the end of the week:

  1. Create a separate tier discount category (External ID containing tier-discount, for example tier-discount-product-week) with its own tier cart discounts, with Valid from and Valid until set to the week.
  2. When the week starts, add the product to the campaign category and remove it from the standing category in the same edit, then publish the product. Category changes, including those made with Bulk edit categories, stay unpublished until you publish them, for example from Review modified products after a bulk edit.
  3. When the week ends, add the product back to the standing category, remove it from the campaign category and publish the product again.

The product must never be in two tier categories that both have a valid tier for the same quantity. If nobody can make these changes on the day, use a product discount instead, as in the next example.

Replacing all tiers with a product discount

For a flat campaign price instead of tiers, for example 30% off a product regardless of quantity:

  1. Create a product discount for the product or category with the campaign percentage.
  2. Set Valid from and Valid until to the campaign period.

While it is valid, the product page shows the product discount and no tiers, and the cart applies no tier discounts to the product. When it ends, the tiers return. The standing tier discounts do not need to be changed. Allow for the product-discount delay: for a large category, start the discount ahead of the campaign or check that the prices have updated.