Remember Me
Log in

Shopping Cart Price Rules and Coupons in Magento 2

Magento 2 Discussion
Written by ITORIS Team, 2017-03-27   


Launching a promotion of store aggregates a lot of successful tips that may put your business on the map. One of them is offering coupons to your potential consumers. It's a good and fast tool to appeal to customers to visit your store more often and build trustful relationships. Magento 2 provides the ability to create coupons with discounts and apply it to multiple products or per product, if conditions are met. You can create a coupon within Cart Price Rules.

What are Cart Price Rules?

Cart Price Rules allow to apply various discounts to products in the shopping cart. The discount can be applied if all conditions are met, or customers enter the coupon code in the particular field.

How to create a coupon?

To apply a coupon with discount you need to complete five main steps.

You can find Cart Price Rules following Marketing -> Promotions -> Cart Price Rules. You may see the grid with already existed rules and created coupons. To create a new rule click "Add New Rule".




There are 4 tabs:

Rule Information – contains general information about a rule and ability to associate a coupon to this rule.

Conditions – allows to set conditions that are necessary for applying discounts. The rule is enabled even if no conditions are met.

Actions – allows to choose a price calculation method.

Labels – helps to identify the discount and can be specified for certain store views.




1. Complete Rule Information

  • Add the name and description to your new rule.
  • Choose "Active" to activate the rule immediately after you save it.
  • Select the websites where the rule is to be applied.
  • Choose the customer groups to which the rule applies. If you need to apply the promotion to registered customers only, do not choose "NOT LOGGED IN".
  • Choose "Specific Coupon" in the "Coupon" dropdown to associate a coupon with the rule.
  • Enter a numeric coupon code in "Coupon Code" that the customer should enter to get the discount.
  • In the "Uses per Coupon" field enter how many times the coupon code can be used. Leave this field, if there is no limit.
  • The "Uses per Customer" field determines how many times the coupon code can be used by the same registered customer who belongs to the selected customer groups. Leave this field, if there is no limit.
  • Set the "From" and "To" date range for the price rule.
  • Enter a number in "Priority" to determine the priority of this price rule in relation to other price rules that might be active at the same time.
  • Set "Yes" in "Public In RSS Feed" to apply the price rule to published listings in RSS feeds.




2. Set the Conditions

The statement has two bold links that display the options. You can create different conditions by changing the combination of following values:




Click link "ALL", and choose either "ALL" or "ANY".

Click link "False", and choose either "TRUE" or "FALSE".

Let's add a condition using this combination "If ALL of these conditions are TRUE: ".

  • Click the "Add" button in the line below.
  • Choose "Payment Method" in "Cart Attribute".




  • Click the "is" link. The appeared dropdown helps to describe the condition to be met. Let's choose option "is not".
  • Click link "…" or "more" and choose the "Cash On Delivery" payment method that means the customer will get the discount if the rest of methods are chosen.

This is how the condition will look like:




3. Define the Actions

  • The "Apply" setting allows to set one of the following four discount options:

Percent of product price discount – discount is calculated by subtracting a percentage from the original price. For instance, the original product price is 100$. After you enter 20 in "Discount Amount", the final price will be 80$.

Fixed amount discount – a fixed amount is subtracted from the original price. Such discount applies to each qualifying item in cart. If the original price is 100$, and you enter 30 in "Discount Amount", the final price will be 70$.

Fixed amount discount for whole cart – discount is calculated by subtracting a fixed amount from the cart total.

Buy X get Y free (discount amount is Y) – a quantity that the customer must purchase to receive a quantity for free.

  • Enter "Discount Amount" as a number, without any symbols.
  • If you choose the "Buy X get Y Free" method, enter the quantity in the "Discount Qty Step (Buy X)" field that the customer must purchase to get the discount.
  • In the "Maximum Qty Discount is Applied To" field, enter the maximum quantity of the same product that can qualify for the discount in the same purchase.
  • Set option "No" in "Apply to Shipping Amount" to apply the discount amount only to the subtotal. Option "Yes" allows to apply the discount amount to the subtotal and shopping amounts separately.
  • In dropdown "Discard Subsequent Rules" choose "Yes" if you need this particular rule is to be applied. This option prevents customers from receiving multiple discounts for the same product.
  • Choose one of the following options in "Free Shipping" to extend free shipping for orders that meet the conditions:

No – free shipping is not available.

For matching items only – free shipping is available only for items that match the conditions of the price rule.

For shipment with matching items – free shipping is available for any shipment that includes matching items.

  • Set additional conditions for the action.




4. Add the Labels

As mentioned above section "Labels" allows to write a label about submitted discounts that appears on the order below the subtotal.

  • Enter your text in "Default Rule Label for All Store Views".
  • If your store has multiple store views, you can enter the translated label text for each view.




5. Save all changes

The rule might be applied within an hour, so check it before the promotion goes live.

We hope that this tutorial helps you to learn more about how to use Cart Price Rules and add coupons in Magento 2.

matteoweb, Jul 18, 2017
"within an hour", really? How can i force automatically the application of all rules as soon as i created these rules?

ps: i create the rules with api, so i can't login every time in the backend to force reindex, apply rules or flush cache...
Alex, Jul 18, 2017
Hello matteoweb,
The rules are processes by cron. Cron should be running in your system. Please find the detailed information here: