Magento: How To Apply Shopping Cart / Checkout Discounts

One great incentive for people to visit your site is the opportunity to receive a discount through a special promotion or via coupons. Magento comes with the ability to create a wide range of special discounts through the use of coupons but not every store owner is sure how to use it. Today you will […]

By Joel Holtzman

One great incentive for people to visit your site is the opportunity to receive a discount through a special promotion or via coupons. Magento comes with the ability to create a wide range of special discounts through the use of coupons but not every store owner is sure how to use it. Today you will learn how to create a ‘shopping cart rule’ which will allow you to create a coupon and have it automatically update a customer’s shopping cart total once they apply the coupon on the shopping cart page or checkout page.

Setting Up The “Rule”

Magento offers discounts through the use of ‘rules’ which is nothing more than a series of logical decisions based on your specifications. In other words, you tell Magento what kind of discount you want, depending on which situation, and then you tell Magento how much to take off from either the sub total, or sub total plus shipping, when a coupon is applied. To create your first rule, and your first coupon, start by logging into your admin and find the ‘Promotions’ tab in the top navigation menu. When you place your mouse over ‘Promotions’ you will see a sub menu with the option “Shopping Cart Price Rules”. Choose that option and you will find yourself on this page:

In my example I already have a rule in place but, assuming you have not created one yet, look for the “Add New Rule” button at the top right of the page. Once you have clicked on that button you will find yourself here:

As you see from this screenshot you start by entering the rule name and description (the rule name is useful for when you are visiting the landing page for ‘shopping cart price rules’ and the description is nothing more than a reminder for you in case you are editing/reviewing multiple rules at a later point in time. Since my demonstration will offer 10% discount on all purchases over $250, I simply titled my rule ‘10% off’ – ideally, your title/description will be more specific than that if you are offering multiple discounts at once.

The next 2 fields on this page refer to the ‘store view’ (just select all options for now) and customer groups. If you want guests (non logged in users) to be able to enjoy the discounts, select “Not Logged In” and if you want logged in customers select “General”. Another thing you can do is just select all of them at once if you do not plan to exclude any customer groups from discounts. The next option is the coupon field – enter a coupon code that you would want people to use. Make sure to keep track of this for future reference such as advertising and then enter that value in this field.

After entering your coupon code you want to specify how many times a coupon can be used. Leave this field blank if you would like an unlimited number of customers to use this coupon. The next field is uses per customer. This is important and it is usually ideal to limit this field value to ‘1’ so a customer cannot continually use this coupon. If you would like to make this promotion available only from a certain time frame then you can enter a ‘start date’ and end date in the next two fields. Magento will make sure that, when the end date’ is over, the discount will no longer apply if the coupon is used. If you are only using one coupon, you can ignore the last field ‘priority’. This is used for Magento to determine, if there are multiple rules, which take ‘top priority’ over others.

Setting Up The Rules

To your left is a set of tabs. You will notice, when creating your coupon, that the top tab is highlighted. Now that you have completed the form for the first step in your discount/coupon creation, let’s create some rules. Click on the second tab and you will see the following:

This section lets you define parameters that determine what the shopping cart rules will be. You start off by clicking on the green button. When you do you will see a whole bunch of options to choose from:

What I usually do is choose ‘subtotal’ because most of the rules I create are based on the idea “You give x discount when the subtotal is equal to, or greater than, $y” and the $y is based on the subtotal (by default, this means without tax and shipping – just the total cost of all of your products in the shopping cart).

In our example we are focused on giving away 10% off for purchases with a subtotal equal to, or greater than, $250 so we will choose ‘subtotal’ in the pull-down field.

At this point, when setting up the rule, we need to tell Magento what the sub total must be. If you look at the screenshot above, or if you have already set ‘subtotal’ as the first parameter, you will see the word ‘is’ in bold and underline. The ‘is’ is actually clickable and is another parameter. This allows you to choose from different logic points such as “subtotal is $100” or “Subtotal is >= 100” or “Subtotal is <= 100”. So click on the ‘is’ and choose ‘equals or greater than’ and you will be presented with a text field that wants you to enter the subtotal dollar amount. In my example I enter the value of ‘$250’ (without the ‘$’, only enter a digit).

After I chose ‘equals or greater than’ as well as entering ‘250’ in the provided text field that accompanies my ‘equals or greater than’ selection, I want to make sure the final set of rules apply properly. It is now time to click on the third tab to your left titled “Actions”:

If you need help with your Magento store, call 845-656-3000 or Contact us here »

This is the section that determines how you calculate this discount based on the rules you provided. The first field ‘Apply’ is very important. You can choose between such options as “Discount this fixed amount” or “discount by percentage”. In the field below that you will enter an integer representing that value which needs to be discounted when your coupon is entered. In our case I would choose “Percent of product price discount” for field #1 and the field below that would have a value of “10”. For the sake of simplicity, I usually ignore the other fields as I am not trying to effect shipping.*

The fields below it are asking you if you want to prevent offering a coupon if a certain total of items is found in your cart (“Maximum Qty Discount is Applied To”) or if your customers need to buy a certain # of items (““). Most of our clients choose to avoid these options as they want a simple ‘sales rule’ to process a coupon and keep their customers happy.

The set of rules below do not have to be set up at all since you have already set up rules. If you wanted to create unique additional logic to filter through your existing rules, such as products with certain category types or attributes assigned to them, you can use them below but for the most part that is only necessary if you are performing a targeted promotion for one type of category or those with a unique product attribute such as ‘computers’. If you need to target those types of products, use the same method you used earlier with the previous rule set up, but pay attention to how different this section is because instead of ‘sub total’ and ‘great than/equal to’ price rules, you are dealing with methods to personalize unique products more so than worrying about sales totals.

How To Differentiate Between The Two “Rules Processing” Options

The rules processing for tab #3 “Actions” is focused on personalizing rules for products/sets of products whereas tab #2, where you applied the rules from this tutoriral, are based on the shopping cart price/subtotal, item quantity (as a whole for your entire cart) or shipping totals. So ‘Actions” is about “What kind of product/products do we look for in order to honor a promotional code/coupon” whereas tab #2 is concerned with the cart as a whole.

Wrapping It Up

Once you have set up your rule, make sure there is no sign of errors and, if you are told that your rule is saved successfully, go ahead and simulate the customer experience and enter that coupon code in the shopping carts ‘coupon’ form. Submit the button and wait for the ‘success’ message (see top left of below image):

You will also see the discount applied to your purchase totals:

Summary

Setting up promotional coupons is very easy with Magento, you just have to know what you are looking to accomplish and remember to differentiate between ‘sub total/cart items as a whole’ discounts compared to ‘only applies to this type of product’ coupons. Take some time to practice a few coupon options until you get the hang of it. Once you have mastered it, take advantage of it by sending coupons to your newsletter, advertise them or just advertise it as a banner on your website. Whatever you do, just make sure you test it out first by yourself to ensure it will work and continue to enjoy one of the many great features of Magento.

* Shipping rules, including those with free shipping, can be tricky. There are many ways to handle this so if you are curious to learn more, feel free to contact us.

Magento Development Lead