Payment Form: How can I have the total amount affected by a number of days?

  • ati1991
    Asked on November 6, 2017 at 2:34 PM

    Is it possible to create a SKI RENTAL with jotform?


    It is necessary to choose the dates and book the skis for these dates. The problem with jotform is that i havent figured out how to calculate the days in between dates and adjust the price of the product accordingly for the amount of days booked.

    Is this possible with conditioning or in any way?

  • aubreybourke
    Replied on November 6, 2017 at 3:56 PM

    Yes its all possible. I have created a demo for you:

    https://form.jotform.com/73096235984972

    You can clone this form and modify it:

    How to Clone an Existing Form from a URL


    Basically you need to use the dates difference widget to calculate how many days:

    https://widgets.jotform.com/widget/dates_difference


    Then you need a form calculation widget to calculate how much per day:

    https://widgets.jotform.com/widget/calculation


    Then you pass that amount on to your payment processor as a user defined amount:

    How to Pass a Calculation to a Payment Field  


  • ati1991
    Replied on November 6, 2017 at 5:09 PM

    Hi,

    I built my form up to the point of calculating the date differnce (which stopped working) and inserting my products.

    How can I now have the price be affected by the amount of days?

    https://form.jotformeu.com/72955402182355

    Martin


  • Kevin Support Team Lead
    Replied on November 6, 2017 at 8:55 PM

    I have checked your form and noticed that your calculation is working: 

    Payment Form: How can I have the total amount affected by a number of days?  Image 10

    Also, I noticed that you're using the sell products payment type, this type does not allow you to pass custom values to the final amount, you will need to perform the calculations on your form in order to be able to affect the total by the number of days. 

    How-to-Perform-Form-Calculation-Using-a-Widget

    You will need to then pass the calculated amount to the payment field as explained by my colleague above. 

    I hope this helps. 

  • ati1991
    Replied on November 7, 2017 at 1:22 PM

    Hi,

    I got a step further now.

    But I have one problem. How can someone add 2 products fo the same type at once?
    In the multiple choice, I have product 1, and if it is selected, one can only buy one of that at a time...??



  • ati1991
    Replied on November 7, 2017 at 1:26 PM

    And so the paypal widgets do not work?

  • ati1991
    Replied on November 7, 2017 at 1:32 PM

    Never mind about the payment option, I found out how to use paypal with the user defined sadsadd

  • ati1991
    Replied on November 7, 2017 at 2:03 PM

    On top of the multiple items at once problem, I have this problem: 

    How can I define a discount depending on the days the items are rented?

    (preferably, I would also add insurance, which would not have to be discounted, but i could but this in a separate multiple choice form, which won't be discounted)


  • Kevin Support Team Lead
    Replied on November 7, 2017 at 2:52 PM

    But I have one problem. How can someone add 2 products fo the same type at once?

    In the multiple choice, I have product 1, and if it is selected, one can only buy one of that at a time...??

    In order to be able to  have quantity fields, you will need to separate the current "Produkte auswählen" field that you have on your form. Please add each product in a single field this way if an option is selected you can show the proper quantity field that may be a short text entry field. 

    This guide will help you showing/hiding the fields based on user's responses: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    Then you will need to add the proper calculations on your widget, example: 

    (product 1 * quantity 1) + (product 2 * quantity 2)

    How can I define a discount depending on the days the items are rented?

    (preferably, I would also add insurance, which would not have to be discounted, but i could but this in a separate multiple choice form, which won't be discounted)

    You're able to conditionally insert values based on the number of days, this will require to add a new short text entry field to your form where you will insert the value to be discounted, then include such field on the calculation that gets the total. 

    This guide will provide you more details about the conditions to insert values on fields: https://www.jotform.com/help/268-How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic 

    I hope this helps. 

  • ati1991
    Replied on November 10, 2017 at 3:54 AM

    Hi,

    I found a great solution to have my form in a more elegant way than the step by step process explained above :)

    Here it is:

    https://form.jotformeu.com/73106601289353


    I still have one more wish though :)

    How can I create a summary of the chosen products before I see the final dollar amount due?

    I would like all the products and their individual prices listed.


    Thanks!!
    martin



  • Support_Management Jotform Support
    Replied on November 10, 2017 at 4:52 AM

    Hello Martin - I'm glad you're making progress. To avoid confusion, I moved your last question to a separate thread https://www.jotform.com/answers/1295628

    We'll address it there shortly.