How to Create a Coupon System for Your Wufoo Payment Forms
By Chris Coyier · August 20th, 2010One of the new payment integration upgrades we released yesterday was the ability to use negative price amounts in your payment settings. One of the cool things you can do with this new feature is allow coupon codes on your forms that can give your users specific discounts. In this tutorial, we’ll show you how to use our Rule Builder and the new negative price feature to create a dynamic coupon system that’ll impress your friends and incentivize your customers.
Step 1 : Create a Coupon Checkbox
The first thing we’ll do is ask the user if they have a coupon code or not. This should help clarify that ordering the product is possible with our without a coupon, which might be less clear if we displayed a coupon code field at all times. In the Form Builder, just add a checkbox field with a single option titled “Got a coupon?” and then directly below that, our Coupon Code text field.
Step 2 : Create a Cloaked Field
In your form, you’ll now need to add a field that we can assign a negative price to in the payment settings. The easiest way to do this is add a Multiple Choice field with a single choice. This may seem a little strange, but this is how we’ll attach the negative prices dynamically to the form and make our coupons system work.
For the Field Title, give it the confirmation message you want to show if the coupon code is valid. In this example, we titled ours “BOOYAH! That coupon gets you $5 off.” For the choice, you can title it whatever you want (this part won’t show to the user when we’re all done), but I recommend using something to remind you of the discount amount you’ll assign to it.
To make the choices and radio input not show to the user just add cloak to the CSS Keyword options under the Field Setting tab for this Multiple Choice field. This is a new CSS Keyword we created that will hide the inputs and choices for any field on a public form, but still show the Field Labels. Very useful in dynamic situations like these where you don’t want the user to be able to manipulate the values of the inputs on the fly, but still want to show some sort of confirmation without having to use a Section Break.
Step 3 : Assign Prices and Discounts in Payment Settings
After you save your form, go to the Payment Settings area for the form and assign the discount amount to the Multiple Choice field using a negative price amount. It should look something like this:
Please note that you have to use fixed values for these negative values. You cannot use percentages.
Step 4 : Add Field Rules to Make Coupon Logic Work
The final step is set up a variety of conditional logic that makes our form respond property to our users input as well as calculate the price accordingly. Here’s what we need to happen:
If the “Got a coupon?” checkbox is checked, show the “Coupon Code” text field. This will make sure the “Coupon Code” field is hidden until the box is checked.
If the “Coupon Code” value is equal to any of our valid codes, show the radio field that has the negative price we assigned to it in the payment settings. When this field shows, then the value will be passed on to the payment processors.
Just set up each Field Rule by wording out the sentence in the Rule Builder. When you’re all done you should have a form that works like our demo coupon code form, which will pass on the coupon codes dynamically to the payment processor like so:
Thanks a lot for following along! We hope you enjoyed learning how to use the Rule Builder and the new Negative Price feature to create a basic coupon system. You can actually get pretty fancy with this setup with a little imagination and play, so we hope you check it out and share with us any cool things you do to enhance your Wufoo payment experiences. Until next time, happy form building!











This looks cool and will be using in the future, keep up the great work…
Posted 1 year ago by Ian.This is great! I absolutly love your app and it just keeps getting better.
Posted 1 year ago by Beth.I agree, wufoo is doing an EXCELLENT job! Sherisse
Posted 1 year ago by Sherisse.Everyone needs a coupon.
Posted 1 year ago by Srini.if you have a logo and would like to print some vinyl stickers, you can use coupon code BOOYAH for $10 off at stickernation.com ! thanks wufoo :)
Posted 1 year ago by Srini.This is excellent, I have been waiting years for this one! I know it doesn’t support percentages, but do you think it’s a possibility down the road?
Posted 1 year ago by InterLingo.Phew excellent! Great work Wufoo, you just keep getting better! Will keep this in mind for a future promo.
Posted 1 year ago by Kim.Using the new Coupon Code ability. Am I stuck with just ONE (1) coupon code, or can I multiple? If Multiple, how do I do this?
Thanks, John Fothergill
Posted 1 year ago by John.I started using this when it came out and I highly recommend it.
Can I ask for one extension (unless you already have it).
Is it possible to add a visible count down tracker to the form?
At the moment, Form Settings offers a “Turn Form Off After” limit.
It would be great to be able to add this to the form for users to see.
That way, the form can be updated to say…
Places remaining: 3
Or…
3 of 10 left!
This sort of functionality would make a really big difference and allow users to offer…
…wait for it…
Deals like Groupon.
Posted 1 year ago by James Tuckerman - Anthill Magazine.Thanks! Super useful!
Q: This works great for a Paypal payment, but I want to allow for discounted payments via bank transfer/check as well. How can I instruct my customer per the discounted price? Is there a specific API code / calculation for that?
Posted 1 year ago by Tomer Hertz.Mental note: If I come across one of these and don’t have a coupon code, inspect the javascript to reveal the coupon code in plaintext.
Posted 1 year ago by Ryan.hey guys, uber awesome stuff but it doesn’t work in a lightbox :|
any idea how could I show an active area with rules in a lightbox?
thx so much!
Posted 1 year ago by Catalin.Another vote for percentage “discounts”. I have a need to collect 50% deposit payments. I’d like the ability to cloak the 50% “discount” so that when clients make a purchase via PayPal, it only collects 50% of the total. PayPal doesn’t have this ability so it would be great if you guys could offer it.
Posted 1 year ago by Kevin.Thanks for the tip! I have just integrated the coupon code set-up on my new website!
Posted 1 year ago by Ryan Crozier - Future Letter.