What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to add discount formula into Form Calculation widget based on selections madeAsked by fieryfoods on April 23, 2015 at 04:24 PM
I need to include discounts formulas in the Calculation Widget which will then be reflected in my PayPal Payment Wizard ("Get total from Calculation").
The formula needs to accomplish the following:
Select 4 Subcategories and Pay for 3 (-$80)
Select 7 Subcategories and Pay for 5 (-$160)
Can you help?
formulas Form Calculation apply discount discount
I took a look at your jotform and I can see the following:
Select 4 Subcategories and only pay for 3! (an $80 savings)
Select 7 Subcategories and only pay for 5! (a $160 savings)
Under it is however:
Product #1 - Select Category(s)
Product #2 - Select Category(s)
Product #3 - Select Category(s)
I presume that the 4 subcategories would be the options under these form collapse tools?
If not, could you please give us a bit more details as to how you wanted to connect it all together?
Yes, the subcategories are under the form collapses -- for now the checkboxes only appear under Product #1, but each product will have all those checkboxes underneath them.
Thanks for your reply.
I think there's a workaround but we need a few more details. How are you going to count the subcategories, is it when any of the options are selected like the following?
In the picture below, there are 3 subcategories filled. Does this mean 3 subcategories are selected?
Or are the counts based on the numbers of options checked?
Please let us know before we can try out different workarounds. My colleague might also have something to add.
Thanks for the response.
The counts are based on the numbers of options selected. For instance, in your screenshot above there are 7 subcategories selected (not 3), so the calculation widget should discount in the amount of $160 (each subcategory = $80). This would constitute select 7 pay for 5. I need to do the same thing for select 4 pay for 3 (a discount of $80).
Hope this helps.
In that case, it would be pretty easy then. :)
First, you have to count the number of subcategories selected.
To do that,
1. Add another form calculation widget to your form, label it "subcounter" or to anything you want. Then hide it if you want (right click the field > hide field).
2. In the calculation wizard, use the COUNT function to get the numbered of selected options per field. Then add them to get the total number of selected subcategories. Check this visual animation.
Sample form: http://form.jotformpro.com/form/51127223556955?
Now you have the total number of selected subcategories, you can proceed with creating the discounts by using "Update field value" condition.
You can add more conditions for the rest of the discounts.
If subcounter is greater than 8, then subtract the total with the number you want like 160.
If you want us to go more in detail or if you need further assistance, let us know. We'd be happy to help. Thank you!
I got as far as setting up the additional Calculation Widget. Beyond that I don't see "Total" as an option in the "Output to Field" section.
This is confusing. Can you go in more detail?
Nevermind! I figured it out!
Thanks for your help! :)
In my colleague's name, you are welcome and I am glad that you were able to find your way around his detailed answer :)
Do let us know if you have any further questions or issues setting it up and we would be happy to assist.