Today I am going to explain yet another part of Magento. I am going to focus on discounts as a means of
customer activation and retention. I offer this guide for those planning to take
Magento 2 Certified Solution Specialist
or similar exams.
Please note that I explain the topic with examples from Magento 2. Still, the content is relevant if you
are under Magento 1.
Let us get started!
- Introduction: Magento 2 promotions
- Promotion solutions from Amasty
- Real-life examples from the support team
Introduction: Magento 2 promotions and discounts
When you want to offer a discount, you need to change the price of the product.
The problem is, one does not simply modifies the cost of every single product. It is more handy to do it
in a bulk.
Magento 2 promotion rules represent the bulk of the discount idea. Instead of dealing with single
products, you can run an automated discount algorithm.
There are two levels of promotions in Magento: cart level and catalog
Catalog-level promotions modify the price of the product itself. The discount is applied
before adding anything to the cart. Like in offline commerce, a store manager can inform shoppers about
the sale by crossing out the “old” price and showing the better price right on the product page.
Example: $10 off for any jacket. It does not matter
how many jackets you buy, what else is in the cart, etc.
A Cart-level promotion helps to offer a better price for particular orders, and
the discount is applied on the cart page only.
Example: buy 4 and get 1 free. You can get one item
for free only if you have four or more products added to the cart. If you have three products, the
promotion will not be activated.
Regardless of the level, we need to define products under promotions and triggering events. In Magento,
this filtering is powered by rule conditions.
Rules in Magento 2: what is a rule condition?
A rule condition is a statement which may be true or false in any particular case. They are used to
filter something or specify a start event.
Note that rule conditions are used not only in promotions. They are also used in:
- Magento 2 Reward Points
How is it used? Customers can get cash-back-style points to be used for future
purchases. Rules help to organize the flow of earning points.
- Magento 2 Up-Sells
How is it used? The conditions are used to automatically specify upsells. For
example, you can show a product as related if material is same as current product material.
- Magento 2 Visual Merchandiser
How is it used? The plugin helps to assign products to the category automatically.
So, if color is red, the product is automatically assigned to “Red” category and shown on its
- Magento 2 Abandoned Cart Email
How is it used? The module tracks incomplete carts to send reminders. Rules are
used to run personalized email campaigns.
- Magento 2 Follow Up Email
How is it used? Rules
are used to generate triggered emails based on the customer’s activity.
- Magento 2 Extra Fee
How is it used? Rules allows taking commission for specific purchases, for
example, the ones paid via PayPal.
- Magento 2 Shipping Suite
How is it used? Conditions are used to filter orders and offer special
shipping price for some clients. For example, you can offer free shipping for $50+
- Magento 2 Customer Group Catalog
How is it used? The extension allows hiding some products for different website
visitors. Using the rules, you can show VIP products only to Silver, Gold or Platinum customer
Condition combinations: how do conditions work together?
Magento allows combining these conditions to get more flexible filtering.
Let’s consider an example here.
If we use “ANY of the conditions are TRUE”, it is enough that one of
the low-level conditions (3) is true. Here’s another example:
At Amasty, we love a customer if ANY of these conditions are TRUE
(i.e. one even is enough):
– This is a new customer.
– This is an existing customer.
If we use “ALL”, every single low-level branch should be true. If even one is FALSE,
the entire high-level condition becomes FALSE too.
My fiancée Yulia kindly suggested a nice example for this case:
The wedding party is perfect if ALL of these
conditions are TRUE:
In case even one the conditions above FALSE, the wedding is not perfect anymore.
Trigger vs target: what is the difference between conditions and actions?
A rule, whatever it is (promotion rule, shipping rule, upsell product rule, etc.), usually consists of
two parts – Сonditions and Actions. These sections may confuse anyone
because they seem quite alike. Their naming may vary depending on the rule types but the key
difference remains the same.
Conditions (i.e. triggers, environment conditions, activation events) are supposed to
specify when we apply a rule. Normally, this is an event or a state.
Actions (i.e. product conditions, target scope) are to specify the behavior type and the
target scope for your rule. Normally, they are products in the catalog.
The statement is the attribute filter.
The rule may be applicable, but there are no items to apply it to. And vice versa – the target scope may
be not empty, but the rule triggers are not activated, so the rule doesn’t apply.
Catalog-level discounts in Magento 2
As I have already mentioned, catalog-level promotions are applied before adding anything to the cart.
They do not have any triggers for starting. Let us consider all of them.
Product pricing is a default functionality of Magento. It includes tier pricing and special pricing.
There are no conditions or rules: product-level pricing just allows setting a special promotion at the level of a particular product.
To learn more, please refer to Magento DevDocs.
Catalog price rules
The catalog price rule extends special pricing. It allows setting bulky sales for a catalog
Here we use conditions to define a target scope:
Activation triggers are not applicable here; the only exception is the start and the end date:
To learn more, please refer to Magento DevDocs.
Cart price rules in Magento 2
A cart price rule is a rule that calculates discounts on the cart page. While catalog-level promotions
modify the price of the product itself, these promotions change cart subtotal.
Example: we want to offer 10% off for $100 orders.
If the order subtotal is $90, there should be no discount.
To apply this discount to particular orders only, we need to filter such orders. In this case, catalog
price rule is not a good tool because it will offer 10% off regardless of the subtotal. This is where
conditions and actions appear.
In its out-of-the-box edition, Magento offers four types of cart price rules. To learn more about cart
price rules in Magento 2, please refer to
Promotion solutions from Amasty
Native Magento rules work well. Yet, they aren’t always flexible enough to attract customers. And here
Magento extension providers step in to help retailers tailor discounts to engage most picky
Below I describe some promotion solutions from Amasty along with the problems they help to solve.
- How to get more options in the conditions tree?
- How to use sales history as a condition?
Magento in its out-of-the-box edition provides basic conditions like “Subtotal is greater than”, “Items
in the cart are”, etc.
This product enables about 20 new types of flexible conditions relying on numerous sources, such as:
These conditions are added wherever a rule takes place: Extra Fee, Shipping Suite, email extensions and
- How to get more options in the conditions tree?
- How to make your offers individualized?
- How to run personalized email campaigns?
In Magento, every customer is assigned to a group. This attribute is static and supposed to be changed
Customer segment is a dynamic entity. It allows grouping customers by conditions:
Like in Amasty’s Custom Conditions, segments can be used wherever rules take place.
- How to get more promotion types?
- How to run advanced discounts calculations?
This module is to add more promotions types to your Magento webshop. By default, Magento has only 4
promotions types. The module offers more than 15 additional cases.
Functionality of Custom Conditions module is included into
Pro version of Special Promotions.
- How to give away a free sample?
- How to upsell non-free products?
This module adds some additional promotion types. Key feature is adding new products to the cart.
- How many coupon codes can be applied per order?
Magento in its out-of-the-box edition allows to use 1 coupon code per order only. This extension resolves
- Applying a number of codes simultaneously;
- Making particular coupon codes unique by making them applicable individually only.
- How to inform my customers about ongoing offers?
These modules help to highlight your ongoing promotions by showing banners or highlighting products.
Example: when sunglasses are in the cart, you see “Best clothes for
this summer” ad.
Real-life examples from the support team
- Case #1 Troubleshooting: How to find out why my rule does
work as expected?
- Case #2
Priorities: How do several rules work together?
- Case #3 Summing
up discounts: How do catalog-level and cart-level promotions affect each other?
- Case #4 How to
enable product attribute missing in the conditions?
- Case #5 What
product types are supported in the conditions?
- Case #6 How to
offer free shipping?
- Case #7 How to
link one coupon code to multiple rules simultaneously?
If a rule doesn’t work as required, it is misconfigured. Here is a short guide on how to find
a mistake in the rule.
1. Validate the scope (website, stores, storeviews).
Sometimes, a rule is available for particular stores and customer groups. You need to enable
the rule for everyone to find out whether this is the reason for its faulty work.
2. Remove all conditions.
If no problems with scope configs are detected, we proceed with verifying activation
triggers. Rule conditions may not be met, so our rule fails to be activated. When you remove
all the entries from the “Conditions” tab (one by one), you can check if they are the
Here is a quick list of
of the kind.
3. Play with Actions.
If previous checks are correct, the possible mistake may dwell in the Actions tab. The very
first thing to check is to erase target scope (section “Apply the rule only to cart items
matching the following conditions”).
Also, it makes sense to switch the promotion type (for example, from fixed to percent
discount) and look at how it works on the storefront. Sometimes the rule cannot be activated
simply because it is not applicable.
4. Use promotions debugger
If you have Amasty’s Special Promotions Pro installed, you can catch the rule that
fails to work properly.
Debug mode enables certain IP address to see all the information available: rule ID, discount
You can find more info
5. Remember about One-Cent Bug
Both Magento and Magento 2 are known to have rounding issues. The thing is, prices have four
decimals in the Magento database (like $23.4476), but they are displayed with two decimals
only (like $23.44). When you do anything with the two values (adding, subtracting,
calculating percent, etc.), the result may be by 0.01 greater or lesser then expected.
These issues are called a One-Cent Bug.
The more operations you have, the bigger the difference.
If you face such a problem, I would advise just to ignore it as a minor issue.
If there is more than one cart price rule enabled, the rules can work simultaneously. The
problem is, they may hamper one another.
For example, we set two promotions:
What should happen when the subtotal is $30?
There are three possible options:
To define how it should work, Magento introduced priorities and subsequent
All the rules in your Magento webshop are sorted by their priorities (1,2,3, etc.) When you
go to the cart page, they will be processed according to this sorting (1, then 2, then 3,
If we review the case above, the priority defines the way to switch from the first
calculation to the second.
Every rule has a blocking field. In Magento, it’s called “Stop Further Rules Processing”, and
in Magento 2 – ”Discard Subsequent Rules”.
If this attribute is set to “Yes” and the rule is triggered, all the rules with lower
priority will not be applied. Basically, this feature is used to restrict discount summing
Let us say, you have a catalog-level discount and cart price
rule running together. Magento default promotion types always sum up discounts.
As you can see, discounts are always summed up in default Magento.
If you have
Amasty’s Special Promotions
installed, you can calculate discount based on:
- Price in the cart (after all the other discounts with higher priority);
- Price after catalog-level discounts only;
- Original price (no discounts regarded).
To learn more, please see this
If the required attribute is not shown in the rules tree, you need to open attribute’s config
and make it enabled for rule conditions:
If you specify an event or trigger, product attributes are displayed under “Product
subselection” rule. The statement will be like:
- If a red item is found;
- If there are two or more items from category “New”.
Configurable, simple and virtual products are supported by rule conditions. If you use bundle
or grouped products (like “SKU is my_grouped_product), the validation will
fail to work.
Additionally to product discounts, a store manager can offer discounts for delivery.
To specify it, please go to your admin panel > Marketing
> Cart Price Rules.
Open any rule and configure “Free Shipping” field.
To learn more about the shipping functionality, please refer to
this shipping guide
Two years ago, one of our clients asked me to link one coupon code to two rules
simultaneously. He wanted to give a 10% discount and a small gift (powered
by Magento 2 Free Gift).
It is deprecated in Magento out-of-the-box edition. However, we found a workaround for this
- Rule 1: adding a gift is triggered by coupon code;
- Rule 2: 10% discount is triggered by adding a gift.
Rule conditions may be really tricky and complicated, but they are also useful and the game is worth
I hope this complete overview will make it clear for you.
In case you’ve got any questions, please drop us a line below.
Wish you good sales!