1. Home
  2. Knowledge Base
  3. Advanced Coupons
  4. URL Coupons
  5. How to apply a coupon with a URL (URL coupons)

How to apply a coupon with a URL (URL coupons)

Sending a coupon code and hoping shoppers type it in loses sales. A URL coupon applies the discount for them: they click a link, and the coupon lands in their cart. This guide covers creating the link, what happens when the coupon has a cart condition, applying coupons through a query string, and how the links behave on a multilingual store.

Prerequisites

  • WooCommerce installed and active.
  • Advanced Coupons for WooCommerce installed and active.
  • At least one coupon created.

Create and share a coupon URL

URL Coupons essentially mean when you can create a coupon and it’ll generate an URL. You can use this link to apply the coupon. This works great for email marketing. You can put the URL in a button and have your customer click the button to apply the coupon.

URL Coupon setting

This works well for an immediate coupon like 15% off the total cart. When the customer clicks the link, they’ll get redirected to the cart and there’ll be a notice in the cart when the coupon is applied successfully.

Default success message

You can customize the success message in URL Coupons > Custom Success Message. You can adjust it to add a specific message or instruction for the customer.

Custom success message

Using a coupon URL with a cart condition

Non-Qualifying Message

If you have set a Cart Condition to this coupon (eg: Minimum cart subtotal of $50), the Coupon URL won’t work immediately if the cart is empty. This is because the coupon is considered invalid because it doesn’t satisfy the cart condition.

Error notice when you’re using Coupon URL with Cart Condition and the condition hasn’t been met.

This could be quite confusing for some customers. The workaround for this is to adjust the non-qualifying message of the cart conditions to clearly describe the requirement. For example:

Customized the non-qualifying message

When a customer clicks the Coupon URL and they haven’t met the condition, it’ll show this notice instead:

This way your customer has a better understanding of why the coupon isn’t applied and they’ll have more information to be eligible for the coupon.

Defer Apply Option

By default, when a coupon has a cart condition and the customer has not met the requirement by the time he visits the Coupon URL, the coupon will not be automatically applied once the requirements are fulfilled. The customer will need to visit the Coupon URL again or manually apply the coupon code.

You can enable the “Defer Apply” option if you want the system to remember the coupon and automatically apply it once the customer has finally met the cart condition.

Redirect back to origin

The “Redirect back to origin” checkbox sends the customer back to the page they clicked the Coupon URL from, instead of the cart page or the URL set in “Redirect to URL”. This is useful when you place a Coupon URL as a button inside a blog post or landing page, and you want the customer to stay on that page after the coupon applies.

This setting only takes effect when the click comes from a page on your own site. If the browser sends no referrer, or the referrer points to another site, for example a link opened from an email client that strips referrer data, the customer is sent to the “Redirect to URL” setting instead, or to the cart page if that field is empty.

The URL Coupons tab showing the Redirect back to origin checkbox

Apply coupons with a query string

To set it, you need to enable this under Coupon > Settings > URL Coupons > Apply Coupons via query string:

Once enabled, you can then use a query string starting from your product page to include a coupon. To access the product page you want to use and add the coupon code you’d like the customer to receive. Sample URL would look like:

http://example.com/some-product/?coupon=mycouponname

Once they access the link with the coupon code, they’ll be redirected to the product page and have the confirmation that the code has been applied:

Coupon URLs on a multilingual store

If you run WPML, the coupon URL is built for the language the shopper is browsing in. A shopper on the Bengali version of your store gets a link like example.com/bn/coupon/mycouponcode/, not the default-language one.

Advanced Coupons 4.7.1 fixed a case where these links were built wrongly. If WPML was set to Use directory for default language, a secondary-language coupon URL picked up both directories and came out as example.com/en/bn/coupon/mycouponcode/. That link did not resolve. From 4.7.1 the default-language directory is dropped, so the link is example.com/bn/coupon/mycouponcode/ as expected.

If you are on an older version and see a doubled language directory in your coupon links, update the plugin. Nothing needs to be reconfigured afterwards.

Changing the coupon URL yourself

Developers can change the generated link with the acfw_coupon_url filter, which receives the coupon URL and the coupon object.

Need help?

If you have a question or run into any issues, we’re here to help.

Was this article helpful?

Related Articles

Complete Your Purchase