Extracting Quantity Bought From Stripe Widget

  • BxClinic
    Asked on November 22, 2016 at 5:00 PM

    Hi there,

    I have a form which uses Stripe payments widget, where visitors will be able to buy a quantity of a product (from 1-6). This number represents the number of tickets they are buying.

     

    When they submit the form, I'd like to send them an email which has a link to another form.

    This second form asks for the name of the visitors, and if they originally said they'd like 4 tickets, it'll have 4 rows containing these fields:

    Name

    Phone Number

    Email Address

    Dietary Requirements etc

     

    I don't know how to get the quantity from the Stripe widget. I assume when that's done I could prepopulate the second form. Could you give me some suggestions please?

    Many thanks

    James

     

  • Support_Management Jotform Support
    Replied on November 22, 2016 at 7:41 PM

    Hi James, since there's no innate way to grab the selection from the dropdown menu of the product on your Stripe Payment field, I'm thinking adding fields that will temporarily hold that info before passing it to another form would be the key.

    I'm currently fiddling around with an example form that you can test with and I'll get back to you on this thread once I have some results.

  • Support_Management Jotform Support
    Replied on November 22, 2016 at 8:09 PM

    All right, we'd need 2 additional Textboxes that will house the value of the dropdown that will be passed to the next form (these can be hidden but I have them displayed for testing purposes).

    1. First textbox named Temp will get the value of the product (this is the only output of the Stripe field)

    2. Then another textbox named To be passed that will conditionally set a value of 1-6 depending on what was fetched from the Stripe payment field

    Here are the conditions:

    Extracting Quantity Bought From Stripe Widget Image 1 Screenshot 50

    Here, we're just getting the value of the selected product from Stripe (e.g. the value may be 150.00, 300.00, 570.00 and so on depending on the number of Tickets selected).

    Once we have that value, we'll create 6 conditions for each. For testing purposes, I only created 1 condition that will match your post, which is for 4 tickets.

    Extracting Quantity Bought From Stripe Widget Image 2 Screenshot 61

    Here, IF TEMP is EQUAL TO 570.00 THEN DO To be passed = 4.

    Now that we have a reference on how many tickets were selected on the payment field, we can now proceed on passing that value to another form.

    To achieve that, set your Form 1's Thank You page to redirect to your Form 2 using this prepopulated URL:

    https://jotform.com/63267784965979?prepopulatedFrom={toBe}

    (where toBe is the field name of the textbox from Form 1 and prepopulatedFrom is the textbox on Form 2 that will get the value passed)

    Extracting Quantity Bought From Stripe Widget Image 3 Screenshot 72

    Related guide: Redirecting-Users-to-a-Different-Page

    Once done, go to Form 2 and create a textbox that will get the value being passed. In my case, I added a textbox named Prepopulated from previous form (and the field's name is prepopulatedFrom).

    RESULT:

    Extracting Quantity Bought From Stripe Widget Image 4 Screenshot 83

    Form 1: https://jotform.com/63267664643969

    Form 2: https://jotform.com/63267784965979

    Related guide: How-to-Automatically-Pass-Form-Data-to-Another-Form

    Now you're free to do your own logic on how you want Form 2 to display depending on the value of the prepopulated textbox.

  • BxClinic
    Replied on November 23, 2016 at 5:14 AM

    Jim,

    You guys are consistently AMAZING!

    I've followed and implemented your suggestion, and am so happy.

    Rather than sending the variable to prepopulate a second form immediately, I'm generating a URL which will be sent by an autoresponder one day after the first form is complete. That way, they get an email immediately thanking them for their purchase, and another email the next day asking them for the names of the people coming.

    I'm so happy that I found Jotform - it's been at least 5 years I've been a user and I send sincere best wishes to you all - you work for an amazing company, and your amazing support makes the company even greater!

     

  • Kiran Support Team Lead
    Replied on November 23, 2016 at 6:04 AM

    That's great!! Glad you are so happy with our service. The feedback that you have provided really boosts our energy levels to give even more quality support. Please do not hesitate to get back to us if you need any further assistance. We will be happy to help.

    Thank you for using JotForm!