How To Create Coupon Code in Magento 2

Table of Contents

From Magento 2 Coupon codes settings, depending on the conditions you set, the Free Shipping can be applied for any order when all conditions are met. At the same time, you can generate multiple codes to offer or just one single code with limited use. With coupon codes, you can provide free shipping in a more extensive way instead of just being able to set minimum order values like other shipping methods. Also, customers can choose to apply coupons or save for further uses.

Step 1: Disable Free Shipping in Store Configuration

In order for Cart Price Rules to work, you should disable free shipping in Stores > Configuration > Sales > Shipping Methods. Because enabling free shipping for all stores will override your promotion or coupon code.

stores configuration view

Step 2: Create new Cart Price Rules

Coupon code in Magento can be set through a cart price rule. After verifying that the free shipping method is disabled, go to Promotions, under Marketing choose Cart Price Rules > Add New Rule

While creating a new rule, you are required to fill all Rules related fields.

set cart price rules name

Magento 2 coupon code is a powerful fuction that allow you to either set one coupon to offer free shipping or generate a batch of coupons with various choices.

Method 1: Create A specific Coupon

On the General Information page, set Coupon to Specific Coupon from drop-down

Enter a Coupon Code to be used with the promotion

To limit the number of times the coupon can be used, choose:

If you leave these fields blank, it will become unlimited use.

select specific coupon from drop-down

Method 2: Create A List of Coupons

Under Coupon Code, tick the Use Auto Generation checkbox

tick auto generation checkbox

To limit the number of times the coupon can be used, choose:

Then, scroll down and expand Manage Coupon Codes section.

Besides, you can apply Code Prefix and Suffix in a specific campaign or initiative.

When complete, choose Generate. It will take a few minutes to generate depends on the number of codes

Coupon code manange section

Step 3: Complete Cart Price Rule and test the rule

Next, expand the Actions section, and select yes for Apply to Shipping Amount.

Set Free Shipping condition to For matching items only.

apply coupon in store views

Later, expand the Label section and enter a default label name that will be seen in stores by customers.

add coupon label name

When complete, choose Save.

Finally, apply coupon on Store views to check whether the coupon is working or not.

Apply coupon on store views

Create Magento Discount Coupon

For discount coupon only, you can follow these steps:

Expand the Action section and set Apply to Percent of Product Price Discount.

set discount percent

Then set the Discount Amount in number. By default, the discount can be applied to all of your products.

To limit the products that receive the discount, expand the Conditions section below and choose Product Attribute combination by clicking green plus symbol.

select product to apply discount coupon

Then Select SKU from Product Attribute, choose the products from the table.

Moreover, we cover how it all works in the video below.

For more information, please refer to Magento 2 User Guide. Learn how to set up free shipping for specific products here.

Last updated: