Home > Docs > Smart Coupons for WooCommerce > Auto Apply Coupons in Cart – Simplify Discounts with URL Coupons and Shortcodes

Auto Apply Coupons in Cart – Simplify Discounts with URL Coupons and Shortcodes

Last updated on June 5, 2023

URL Coupons is a feature by Smart Coupons for WooCommerce plugin that enables you to pass a coupon code in a URL and apply it automatically to any page while preserving the usage restrictions. You can easily create URL Coupons by appending the coupon code to a link, making it effortless to promote your deals both externally on other sites or internally on your own site. This feature also provides flexibility in embedding the coupon within texts, images, or any other element that matches the theme of your website. To implement the URL Coupon, simply use the following syntax:

<site_url>/?wt_coupon=<coupon_code>

For example, to implement a URL coupon in the cart page of a website www.webtoffee.com with the coupon code FLAT30, specify the URL coupon in the following format:

https://www.webtoffee.com/cart/?wt_coupon=flat30

Automate Cart Discounts with URL Coupons and Smart coupon shortcodes

As mentioned above, there are multiple ways to embed a coupon that can automatically apply a cart discount. Consider an example of linking the URL with the shortcode of the coupon.

  • Create a post where you want to display the redirecting text/image/any other element. In this case, the shortcode of the coupon. To know more about shortcodes click here.
  • Enter the element(shortcode) on the page.
  • Create a hyperlink to the element and enter the site URL in the given format(https://www.webtoffee.com/cart/?wt_coupon=flat30).
  • Finally, click on Publish/Update.
Smart Coupons for WooCommerce - URL Coupons with shortcode demo
Smart Coupons for WooCommerce – URL Coupons with shortcode demo

Now you can simply click on the coupon element on the published page to get redirected to the cart, where the coupon will automatically apply.

Smart Coupons for WooCommerce - URL Coupons with shortcode demo
Smart Coupons for WooCommerce – URL Coupons with shortcode demo

Alternatively, you can use images text or any other element to automate discounts with URL coupons.