By: Mike Wong Back to Guides
Hey, gang! I’d like to share with you my method for creating a payment form that can offer discounted pricing depending on the day the form is submitted.
To accomplish this, we’ll be using several key Wufoo features in tandem:
Building the form
We’ll start first by adding a date field to the form. Next, in the “Predefined Date” setting add the value today. This relative value will ensure that whenever the form is loaded, that day’s date will populate the date field by default. (For a list of additional relative dates and formats Wufoo supports check this out.)
Since we don’t want the date field to be changed by the form user, apply the CSS keyword hide to the field.
Now I’ll add a field that will allow the form user to select the # of tickets to purchase. I’ll make the first field for the purpose of assigning discounted pricing, and then duplicate it. The copy of the field will be for regular event pricing.
Adding the Rules
From here, we’ll save the form and click to return to the Form Manager. From this page, we’ll click the “Rules” button to access the Rule Builder.
First, select the Date field as the basis for our rule. Then we’ll define a date that is one day after the cut off date for our discounted pricing. That way, any entries that are submitted before this cutoff date will qualify for the discount. With this rule being true, we’ll also want to show the early bird pricing field.
The next step, will be to create the conditions for the standard price dropdown to show.
Now to pull it all together we’ll assign pricing! After saving your rules, return to the Form Manager and then click the “Payments” button for your form. Here we’ll assign pricing to each of the dropdowns field choices. One is set to discounted, the other standard.
Click save, then view your form and you should see the field rule in effect displaying the early bird pricing field!
Before releasing your form out into the wild, you might want to test your rules to ensure that the proper field will display once the discounted time window has passed. This is easy to do. Just edit your form, and in place of the relative value today use a specific date outside of the discounted price window.
Which should in turn give you…
And there you have it. I hope this bit of fancy form building serves you well. :D
If you have any questions about this tutorial, ideas for a future guide, or just want to say ‘ello, feel free to leave us a comment!