How can I create a total from a matrix and then update that value into a payment form?

What is JotForm?

JotForm is a freeonline form builder which helps you create online forms without writing a single line of code.

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.

Why do you not want to answer this thread?(Your answer will be sent to Jeanette and Aytekin)

grrguitar98

Asked on March 20, 2017 at 05:00 PM

I have a hanging basket sale form, each flower basket is $16. I created a matrix that shows names of flower types and then the quantity of each flower to be purchased. Then I used the Form Calculation Widget to add up all the quantities of the flowers from the matrix for a Total Orders. I cannot get the calculator to add up the total number of flowers ordered. It seems the first row of the matrix is the 100s column, the second row 10s, and so on. So if you want 1 Fushia, 2 Impatiens, and 3 Geraniums, the Total Order shows 123 instead of 6.

Secondly, I would like to take the Total Orders value and copy it into the payment form. I'm using PayPal and I have created one product that is $16 dollars. If a user orders 6 flowers then I would like the PayPal product to increase it's quantity to 6 on its own so that the person cannot lie about the order amount to save money. Thanks.

1. I added the matrix fields and multiplied it by 16 (your flower's based price)

2. I set your payment field to collect user-defined amount and then pick the calculation field from the list.

You can also achieve this in the payment field alone since you can define quantity per product in the wizard. However, you can choose whichever solution you prefer.

Thanks!

grrguitar98

Answered on March 21, 2017 at 08:57 AM

Thank you, this is what I was wanting. I added a condition to disable the payment form so the user cannot change the value in the PayPal field.

I didn't like creating this in the payment field alone because when it was logged, all the basket orders for that person were put in one cell for an Excel document. This prohibited me from easily counting up the total amount of baskets per type after everyone has filled it out.