By: Mike Wong Back to Guides
Hi gang! I’d like to share with you my method for creating a payment form that can offer discounted pricing according to the day when the form is submitted.
To accomplish this, we’ll be using several key Wufoo features in tandem:
Building the form
We’ll start by first 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 that 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 number 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. In this way, any entries that are submitted before this cut-off 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 be displayed.
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 dropdown field choices. One is set to discounted; the other to 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, instead 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 or ideas for a future guide, or even if just want to say hello, feel free to leave us a comment!