Creating a WooCommerce Redeem Coupon Page

Originally published at: http://www.sitepoint.com/creating-a-woocommerce-redeem-coupon-page/

In this article, we will explore a unique way of allowing your customers to easily redeem a product or group of products they may have paid for already perhaps at a conference or other similar event.

Let’s talk a bit more about the concept. Say you are a store owner with a revolutionary new product and you present it to thousands of people at a conference. At the end of your speech, those customers willing to try your product can do so and pay for it ahead of time. You may even have enticed them by lowering your price to the first 500 customers.

In this scenario, what you’ll do in WooCommerce is create 500 coupons, with a product discount of 100%. You could use the Smart Coupons plugin to generate these 500 coupons so that you don’t have to create them manually. Each customer who paid in advance gets a coupon code but as far as the customer knows it is just a code to redeem the products.

Creating the Coupon Codes

If you are serious enough about your offer, then you will try to make the coupon codes look random and make it hard, if not impossible for users to come up with a valid coupon code. Make sure you select which products are tied to this coupon so we can add them to the cart automatically later on. Take a look at one of the coupons I created, pay close attention to the settings:

Continue reading this article on SitePoint

Hi there,
Thanks for this useful tutorial. I was wondering if this will work for a variable product as well and how this should be implemented ?

It should work for Variable products, too.

Hi Yojance,

I should have been more specific I think. I’m using coupon codes for a product which has several variations. So when the customer redeems this coupon code they still have to select the variation they want (i.e… language of the file). I’m not sure how this will work.
I had some problems adding the code to my functions.php. When adding the jquery part, I get this error message : Parse error: syntax error, unexpected ‘)’, expecting ‘&’ or T_VARIABLE in /home/…

I too would like an update on how to properly implement this workaround.

The ajax handler and coupon logic code in functions.php is in place, and in my case I added the jquery in the same page as the form. Unfortunately nothing happens when the coupon code I created is applied.

Perhaps is due to the latest version of woocommerce not being compatible with this solution, or we are missing something during set up O_O

Update: Silly me, my jquery needed to go in a separate file which then needed to be called from functions php. Works now :slight_smile:

Thank you for this tutorial I have found it very useful

Is it possible to apply the voucher during this process?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.