Coupon code management in Magento 2 is effective as long as your customers find coupons easy to apply. You can create coupon codes in Magento and promote them on your store, in email, or through social media. 

By and large, however, you just leave them to chance since you can't track if customers use your coupons. They have to copy and paste or enter it manually on the shopping cart or checkout. 

This still doesn't mean they will finalize their orders. 

What if we told you that you can automatically apply your coupon code, add products to the cart, and redirect customers to checkout all in one click?

Though it may sound difficult, there is no difficulty in it neither for you nor your customers. Magento Coupon Code Extension makes it a breeze.

So, today you're going to learn more about coupon code widgets and how you can use them to boost discounts. And there are two cases we'll walk you through.

How to Add Coupon Code Widget in Magento? 

1. Go to CMS page, block, blog post or any page with the WYSIWYG editor where you want to add the coupon code widget.

2. Press the Insert Widget button and select the Coupon Code by Magefan as Widget Type.

3. Select the Cart Price Rule that should trigger the discount.

Note: the cart price rule you choose should have a specific or autogenerated coupon assigned, since if there is no coupon — the widget simply won't work.

4. Choose whether to Enable a Link.

5. Specify the Redirect URL where your customer will be directed after applying a coupon code. 

You can leave this field blank so customers are redirected to the homepage or enter CURRENT_PAGE to let them stay on the same page. Besides, you can also specify any other website link to point customers to, like a specific category, product, or shopping cart.

6. Set the Auto Generated Coupon Code Length. Coupon Code Widget automatically generates a unique coupon code with the set number of characters for each customer.

Coupon Code Widget Magento

Note: this option is valid only in case you have the auto-generation option enabled in the cart price rule so all generated coupons are stored there. Otherwise, a specific coupon is used.

7. Insert Widget and check how it performs on the storefront. 

Special Discount Coupon Code

Once customers press on this coupon code, they will be redirected to the page you specified and see a success message about the coupon being applied.

Coupon Code Success Message

In case you want to apply this coupon code to your email templates, just copy the widget code, and paste it into your template Information. A unique coupon code will be sent to each customer. 

Magento Email Templates

How to Add Products to Cart while Applying Coupons?

Now we come to the best part of the coupon code widget. Add to Products and Product's QTYs options indicate what products and how many of them you want to be added to the customers' shopping cart when they apply the coupon code.

All you need to do is to fill out all of the same options we just did and set Products and QTYs. If you want to add multiple products, just separate them and their quantities by commas.

Add Products to Cart Automatically

Note: the order in which you add the quantities corresponds to the order of SKUs. Be attentive there.

e.g. in this example, we set that we want to add 1 item of 24-MB01 and 2 items of 24-MB06.

Once we go to the same page we applied the coupon code widget to and click on the coupon, it is automatically applied and redirects us to the shopping cart. There we can see the products we specified in corresponding quantities.

Coupon Code in Shipping Cart

It took a blink of an eye to apply the coupon and add products to the shopping cart.

This opens so many opportunities for you. You can encourage customers to make purchases instantly, just after they land on your website. Your newsletters or abandon cart emails won't be the same anymore since what separates your customers from getting a discount is literally one click.

In case you want to add coupon codes in social media and other sources where coupon code widgets can't fit, use coupon code links. It can improve sales and make shopping in your store more user-friendly.