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.

  • Profile Image

    Payment Integration [User Defined Amount]: How can I add a coupon code to my form calculation?

    Asked by SunbridgeInstitute on May 16, 2017 at 03:15 PM

    Thanks for the help. Most of the fields can be ignored, and I will describe what I'm trying to accomplish with the calculation:

    The total in the "Total Cost Calculation" is supposed to be:

    1. the number from "I wish to purchase",

    2. doubled if there is a second person ("would you also like to register a second person?"=yes)

    3. plus the donation amount, if any ("enter the amount you would like to donate")

    This part of the calculation seems to be working fine now (I found a mis-coded parens in my formula), but now for the part that I was having trouble with...I'd like to add a coupon, with the code "WAIVE". The amount of the coupon is calculated "I wish to purchase" x2 if there is a second person. The donation amount should remain after the coupon has been applied. 

    I have set up 2 fields for this: "Coupon Code," and "Discount." I thought I had it all figured out how to use the conditions and calculations, but nothing I tried worked. If you can give me a headstart, I would appreciate it.

    Thank you!

  • Profile Image
    JotForm Support

    Answered by Kevin_G on May 16, 2017 at 03:30 PM

    I have cloned your form and noticed that you have added both fields, as you're mentioning the calculation works and I can see the coupon code fields are hidden and its conditions disabled. 

    Firstly, I can see there is a condition with a missing field, this may affect the other conditions on your form so I would suggest you to either fix the missing field, delete the condition or disable. 

    I have enabled the conditions on your form and changed the discount to "10", so far I can see it is working fine. 

    These are your current conditions, I changed only the discounted amount: 

    Finally, I edited the Total Cost calculation widget and added the discount like this: 

    Could you please try doing the same on your end? 

    1. Enable the conditions for the coupon code. 

    2. Disable the condition with missing field. 

    3. Change the calculation for total cost similar to what I did on my cloned form. 

    You could also take a look on how it works here: https://form.jotformpro.com/71356275941966 

    Do let us know how it goes.