Discount Campaigns in Magento 2: Coupon Codes, Countdown and Loyalty Points Done Right
AI generated
M2
di.xml
Marketing · Discount Campaigns · Coupons
Discount Campaigns in Magento 2 Done Right
Coupon codes, countdowns and loyalty points without margin traps and legal pitfalls

Discount campaigns are the fastest way to generate revenue and at the same time the easiest way to burn margin. Magento 2 provides powerful standard features with catalog and cart price rules, but which rule fits which goal is a question the system does not answer. This article explains the difference between the two rule types, shows how a coupon code arrives by link, when a countdown stays honest, what applies to disclosing the lowest price of the last 30 days for price reductions, how to keep margin and cannibalization in view and when a loyalty points program pays off. Legal remarks are general information and not legal advice.

12 min read Coupon Codes Countdown Loyalty Points Price Rules

1. Goal first, discount second

Before you create a rule, answer the question of what the campaign should achieve. Winning new customers, clearing stock, raising the cart value and rewarding regulars are four different goals, and each needs a different instrument. A discount across the entire range usually achieves a little of everything and nothing properly.

Also decide how you will measure success before the campaign starts. Without comparison figures you cannot say afterwards whether revenue rose because of the campaign or despite it. So note the period, target group, discount type and expected effect in advance.

2. Catalog price rule or cart price rule: the difference in Magento

Magento knows two rule types, found in the marketing menu under promotions. A catalog price rule changes the displayed price of a product already in the category and on the product page. It is applied through the indexer, so it needs a running cron, and it suits price campaigns on parts of the range, such as a category or a brand. The customer sees the reduced price without entering anything.

A cart price rule only takes effect in the cart. It can be tied to conditions, for example minimum order value, certain products or customer group, and it can be linked to a coupon code. That makes it suitable for campaigns such as 10 euros off from 80 euros cart value, or welcome discounts. Both types support runtime, customer groups, websites and priorities, and the option to stop processing further rules controls whether discounts add up.

Check every new rule with test orders in several combinations, because the interplay of several rules often surprises. Our marketing extensions extend the standard rules where you need more conditions or automation.

3. Coupon codes: types, limits and validity

With a cart price rule you choose whether no coupon, a fixed coupon or automatically generated codes are used. A fixed code is easy to remember but can be passed on and posted on coupon portals. Automatically generated codes can be created in large numbers, redeemed once each and sent to individual recipients. That protects campaigns meant only for a specific group.

Always set limits: uses per code, uses per customer, start and end. Without limits a single code can generate revenue on poor terms for months. Also decide whether the discount applies to items already reduced and whether it can be combined with other campaigns, and communicate these conditions visibly.

Codes that must be typed in the cart often get lost. Visitors forget them, mistype them or leave the page while searching for the code. A link that stores the code on arrival removes this hurdle. To our knowledge Magento does not include such a link in the standard, but it can be added with a small custom module or an extension.

The idea is simple: the target address contains the code as a parameter, a module reads it, keeps it in the session and applies it to the cart as soon as one exists. Make sure the parameter does not process unchecked input and that only valid codes are applied. Afterwards show the visitor clearly that the code is active, for instance with a notice at the top of the page.

5. A countdown only if it is genuine

A countdown creates urgency, and that is exactly where the risk lies. A timer that silently restarts after expiry, or a note about scarce stock that is not scarce at all, deceives consumers. Such practices can be judged misleading under the Act against Unfair Competition. Use a countdown only if the campaign really ends at the displayed time and the old price applies afterwards.

The cleanest approach is to feed the timer from the same end date stored in the price rule. Then display and reality necessarily match. The following example shows a small Alpine.js component that counts down a server rendered end date and hides the timer as soon as the time has run out.


// Countdown fed by the end date of the price rule (ISO 8601, written by the server)
Alpine.data('promoCountdown', (endIso) => ({
  remaining: '',
  expired: false,
  timer: null,
  init() {
    const end = new Date(endIso).getTime();
    const tick = () => {
      const diff = end - Date.now();
      if (diff <= 0) {
        this.expired = true;
        clearInterval(this.timer);
        return;
      }
      const hours = Math.floor(diff / 3600000);
      const minutes = Math.floor((diff % 3600000) / 60000);
      this.remaining = hours + ' h ' + minutes + ' min';
    };
    tick();
    this.timer = setInterval(tick, 30000);
  },
}));

6. Price reductions: the lowest price of the last 30 days

A note first: this section is general information and not legal advice. Under section 11 of the German Price Indication Ordinance, a trader who advertises a price reduction to consumers must in principle state the lowest price of the preceding 30 days. This concerns campaigns with a struck through price, percentage claims or wordings such as now cheaper. There are exceptions and detail questions, for example for prices that change gradually and continuously.

For Magento this means the earlier price history must be traceable. A catalog price rule changes the price automatically without documenting the earlier price anywhere, so you need a way to capture and display the lowest price of the last 30 days. Whether a coupon code counts as a price reduction within the meaning of the rule depends on how the advertising is designed, and that is exactly what you should clarify with your legal advisor. Information on search visibility can also be found under Magento SEO.

7. Margin and cannibalization: what a discount really costs

A discount hits profit harder than revenue. A simple example shows it: if an item costs 60 euros to buy and sells for 100 euros, 40 euros of gross profit remain. With 20 percent off the selling price drops to 80 euros and the gross profit to 20 euros. The margin per unit halves, so the campaign has to sell roughly twice as many units just to reach the same gross profit. The numbers are a worked example, not an industry figure.

Then there is cannibalization. Customers who would have bought anyway use the discount as well and lower the profit without creating extra revenue. So limit the campaign to products with sufficient margin, to new customers or to specific customer groups, and calculate in advance how much additional revenue is needed. Shipping costs and returns belong in this calculation too.

8. Loyalty points: rewarding repeat purchases instead of cutting prices

Loyalty points start where discounts fall short: retaining existing customers. Instead of lowering the price immediately, the customer collects points and redeems them on a later purchase. That moves the discount into the future and gives a reason to come back. To our knowledge a points program is not included in Magento Open Source, while Adobe Commerce offers reward points as its own feature. For Open Source an extension is an option.

Clarify the rules before launch: how many points per euro, when do they expire, what happens on returns and cancellations? Points are a liability of the store, so expiry, reversal and data protection belong in the terms of participation and in the bookkeeping. Keep the program simple, because a model nobody understands will not be used.

9. Measuring and evaluating campaigns

Evaluate every campaign after it ends. What matters is the revenue during the campaign compared with an equally long period before, the redemptions per code, the average cart value and the gross profit after discount. Also check whether a slump follows in the weeks afterwards, because then purchases were merely pulled forward. You find redemptions in the reports on the promotion rules and the other figures in your web analytics.

Record the results and build a campaign calendar with clear occasions. Anyone who discounts constantly trains customers never to pay the full price. For orientation on effort and cost of setting up campaigns see our pricing overview, and for further add ons see Magento 2 extensions.

Instrument Acts on Strength Watch out
Catalog price rule Displayed price in category and product page Customer sees the discount without input Needs indexer and cron, price history must be documented
Cart price rule Price in the cart Conditions and coupon code possible Test the interplay of several rules thoroughly
Countdown Speed of decision Makes a genuine campaign end visible Only with a real end date, no fake scarcity
Loyalty points Repeat purchase and retention Moves the discount into the future Open Source needs an extension, define expiry and reversal

Mironsoft

Magento development, module consulting, and system architecture

A Magento project that needs a second opinion or experienced execution?

We build custom Magento modules, advise on architecture decisions, and take on complex implementations, from service contract planning to production-ready deployment.

Architecture Consulting

Have module and system architecture thought through properly before you build.

Custom Module Development

Build custom Magento modules cleanly, following best practices.

Code Review & Audit

Have existing modules reviewed for performance, security, and maintainability.

10. Summary

Discount Campaigns: The Essentials at a Glance

Rule type

Catalog price rules lower visible prices, cart price rules work with conditions and codes, and both must be tested.

Honesty

Countdown only with a real end date, and clarify the lowest price of the last 30 days for reductions with your legal advisor.

Profitability

Calculate in advance how many extra sales a discount needs and limit campaigns to products or groups with sufficient margin.

Retention

Loyalty points reward repeat purchases but require clear rules on expiry, returns and data protection.

11. FAQ: Discount Campaigns: The Essentials at a Glance

1What is the difference between a catalog and a cart price rule?
The catalog price rule changes the displayed price already in the category and product page, while the cart price rule takes effect only in the cart and can work with conditions and coupon codes.
2Can I distribute a coupon code by link?
To our knowledge Magento does not include that in the standard. With a small custom module or an extension the code can be read from the address and applied in the cart.
3When is a countdown in the store acceptable?
When the campaign really ends at the displayed time. A timer that resets or invented scarcity can be misleading. When in doubt, seek legal advice.
4What does section 11 PAngV say about the lowest price of the last 30 days?
In general, when advertising a price reduction to consumers, the lowest price of the last 30 days must be stated. Exceptions and details are for your legal advisor, this is not legal advice.
5Must I state the lowest price for coupon codes as well?
That depends on how the advertising is designed. Have the concrete wording reviewed legally instead of relying on a blanket answer.
6How do I limit a coupon code in Magento?
In the cart price rule you can set uses per code and per customer as well as start and end. Always set at least an end date.
7How much extra revenue does a discount need?
That depends on your margin. With an item earning 40 euros gross profit, a 20 euro discount halves the profit, so about twice as many sales are needed for the same gross profit.
8Does Magento Open Source offer loyalty points?
To our knowledge a points program is not included. Adobe Commerce includes reward points as its own feature, and for Open Source an extension is an option.
9What happens to loyalty points on a return?
The terms of participation should regulate this. It is common to deduct points for returned goods. Consider expiry and bookkeeping at the same time.
10How do I know whether a campaign paid off?
Compare revenue and gross profit with an equally long period before and check whether a slump follows afterwards. The number of redemptions alone says nothing about profit.