Automatically apply WooCommerce coupon codes to the cart via a url.
Contributors: Luke McDonald
Requires: 3.5
Tested up to: 3.6.1
License: GPL-2.0+
First, you will need to setup a coupon code in WooCommerce. The coupon code can then be applied by adding a coupon_code
query argument to the cart URL.
http://audiotheme.com/cart/?coupon_code=couponcode
If the cart is empty, the coupon code will still be applied and visible once the user adds a product.
Probably more useful than just applying a coupon code to the URL, is appending the coupon code argument to the end of a product add-to-cart url.
http://audiotheme.com/view/americanaura/?add-to-cart=192&coupon_code=couponcode
In the above example, a product with the id of 192
will be added to the cart with the couponcode
coupon applied.