Coupon codes are a simple but powerful tool to offer a discount to customers on your site. This can help turn them into returning, repeat customers. This is a great way to boost sales and overall business for your online store.
Coupon codes are a Cart Price Rule that can be created to apply a discount for a fixed amount, percentage, free shipping, and several other scenarios. In this scenario, we will be creating a coupon code that takes a percentage off items in the cart. The discount will be automatically applied to the cart after the code has been entered in by the customer and all specified conditions of the promotion rule have been met. While this article explains how to create
While this article explains how to create a coupon with specific coupon codes that are required to be entered in by the user in order for the discount to be applied, you can also create coupon codes that are automatically applied without an actual code being entered in.
Coupon codes can be created for all users, users who make a purchase over a specific amount, or a particular customer group.
Creating Coupon Codes for Percentage Off Discounts
Step 1
Log into the back-end administrative dashboard of your Magento 2 store
Step 2
Go to Marketing >> Promotions >> Cart Price Rules
Step 3
Click the Add New Rule button at the top right
Step 4
Open the Rule Information tab and enter the appropriate info for this rule.
- Rule Name: The name of this promotional rule
- Description: Information on what this rule is for, what type of promotion is being offered (for internal uses – not seen by customers)
- Active: Sets the rule to either Active or Not Active
- Websites: Select which site this rule can be used for
- Customer Groups: Select which specific customer groups can use this coupon code. If this coupon can be used for all customers, select every available customer group listed in this section.
- Coupon: Select “Use Specific Coupon”.
- This will open Coupon Code: In this field, you can manually enter the coupon code that customers will enter for this promotion
- Uses Per Coupon: Limit the amount of times this coupon code can be used – For unlimited use, leave this field blank
- Uses Per Customer: Limit the amount of times this coupon code can be used for a customer who is logged in – For unlimited use, leave this field blank
- From/To: Select a date range for when this coupon code/promotion will be active – For no start or end date, leave these blank
- Priority: This sets the importance of the rule. The lower the number, the higher the priority, when other rules are in place.
Note: You can click ALL and change it to ANY – You can also click TRUE and change it to FALSE. For our example, change “ALL” to “ANY”
Step 5
Click the green plus sign to open a drop down of options to select.
Note: For our example, we’ll be creating a condition that only provides a discount for a specific product found in the cart
Step 6
Select Product attribute combination from the drop down.
- A line will appear that says, “If an item is FOUND in the cart with ALLof these conditions true:” (NOTE: You can click FOUND and ALL to change these specifications)
- For this example, change ALL to ANY
- Click the indented green plus sign to open a new drop down of items to choose from
- These items include Cart Item Attribute items to choose from (such as price in cart or quantity in cart) or Product Attribute to choose from (such as SKU or Category)
- Select SKU from Product Attribute
- The next line will say “SKU is …” – click “is” – change this to “is one of”
- NOTE: This step is extremely important if there are multiple SKUs applicable to the rule. If this is left on “is” and multiple SKUs are added to this rule, the coupon code would only work if ALL the matching SKUs were added to the cart.
- On that same line, click the three dots “…”to continue to the next step
- Click the Chooser icon to search for and select your SKU(s) for this rule to be applied to
- After selecting the SKU(s) that this rule will be applied to, click the green check mark next to the Chooser icon at the top – this will close the list of products
- Now, you’ll see the Conditions that you’ve set for this rule
Step 7
Set specific details for the coupon under the Actions tab.
- Apply: This is where you choose which discount method you want to use, your options are as follows:
- Percent of Product Price Discount: This will discount the items in the cart by deducting a percentage from the original price (ex. 30 entered into the Discount Amount field will apply a 30% discount). For our example, select this option
- Fixed Amount Discount: A set amount will be deducted from the original price (ex. 30 entered into the Discount Amount field will subtract $30)
- Fixed Amount Discount for Whole Cart: This will deduct a set amount from the entire cart total
- Buy X Get Y Free: This defines a quantity that customers have to purchase to receive a quantity for free
- Discount Amount: The discount amount you’re offering for this coupon. For our example, enter “30” into this box.
- Minimum Qty Discount: The quantity of products on which the discount will be applied.
- Discount Qty Step (Buy X): If you have selected the “Buy X to get Y free” discount method, this is where you specify the quantity of a product a customer must buy to get Y free. (Percentages of the product price can be used as well.)
- Apply to Shipping Amount: Set this to “Yes” if you want to apply the discount rule to the shipping cost as well.
- Discard Subsequent Rules: Select “Yes” if you don’t want a customer to be able to use other rules after this, if this one is being used.
- Free Shipping: Choose an option from the drop-down if it applies to your rule.
- No: Free shipping will be excluded from your rule
- For Matching Items Only: Free shipping will only be available for items in the cart that match the rule.
- For Shipment With Matching Items: Free shipping will be available for the entire cart when a coupon based on the rule is applied.
Step 8
Next, we’ll go to our cart page where we’ll then enter the coupon code “30specialcoupon” – This is now applied to the product in the cart, since the product matches the conditions for the rule:
Saving and Testing
Once your rule has been created and configured, click the Save button at the top right of the page. Voila! Your coupon code and any applicable conditions have been created.
Now you’re all set to test the code out by adding a product to your cart and entering in the coupon code.
NOTE: If your coupon code conditions are configured to only apply to specific products, make sure that you add those specific products to your cart for testing.
Final Thoughts
You should now know how to create a coupon code for a percentage off discount on your Magento 2 store. With nearly endless options on how to set up discounts and coupons on your Magento 2 store, the power to customize is really in the store-owners hands. Customer Paradigm is always looking for ways to help store owners find success! Feel free to contact us or reach out on Twitter with your feedback!