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.
Venda de um produto composto por dois outros produtosAsked by Soargui on June 30, 2016 at 01:29 PM
O problema é este: montei um formulário para emissão de pedido (não haverá pagamento online) para vender pizza de mussarela, pizza de calabresa e pizza meio a meio (metade mussarela e metade calabresa). Para não ter que cadastrar todas as possibilidades de meio a meio ex: mussarela/calabresa; mussarela/palmito e assim por diante, minha ideia e permitir a venda de 0,5 pizza, desta forma posso "montar" os sabores que quiser e para saber o total do pedido eu marco 0,5 pizza de mussarela com 0,5 pizza de calabresa. Mas é preciso que o formulário consiga calcular o preço de 0,5 pizza, pois ao comprar metade de pizza com sabores e preços diferentes o formulário faça a soma de metade do preço da pizza de mussarela com a metade do preço da pizza de calabresa. Falando em números:
- Pizza de mussarela = R$ 20,00
- Pizza de calabresa = R$ 40,00
Quando o cliente escolher meio a meio mussarela com calabresa, o formulário precisa calcular: R$ 10,00 (0,5 mussarela) + R$ 20,00 (0,5 calabresa) = R$ 30,00, ou seja, o preço das metades escolhidas.
Bom é esse o meu problema, se houver uma saída por favor me informe pois só falta isso para finalizar um app que irá usar o formulário dos senhores.
I see you already have a form titled "PEDIDO ONLINE", and you are using a "Purchase Order" for the products.
If you need to have a complex calculation like in your example, you will need to recreate the products using simple fields, then use a form calculation widget and pass them to your payment's total field.
Here's what I meant:
1. Here's my cloned form: https://form.jotform.com/61815419541961. You can clone it to have a version of it in your account. Here's how to clone my form: https://www.jotform.com/help/42-How-to-clone-an-existing-form-from-a-URL
2. Now first recreate the pizza products using simple fields like check boxes:
2. Now add form calculation widgets as "Quantity" and as "Calculation" (this is the total price).
3. Now we will assign a calculation value on the pizza products in check boxes. Here's a guide to help you further: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value. Here's how I did mine. Select the check box and click "Edit Properties":
4. Now assign the price value in the calculation value. In my case, the pizza de mussarela is priced at R$ 20,00.
Now repeat the process for the other pizza products in check boxes.
5. We will now set the quantity field in the form calculation widget. Select the widget and click the wizard icon.
6. In the wizard icon disable the "Read-only" AND enable the "User commas for decimal points" which I presume is what you need:
Now repeat the same with the other quantity field.
7. We will now do our calculation. Now add again a form calculation widget that will serve as the final total. I named mine "Calculation".
8. In the Form Calculation widget, you can do calculations and use other fields. In our case, this is the formula:
( Pizza 1 * Quantity ) + ( Pizza 2 * Quantity ) = Total Price
Make sure that you enable the "Use commas for decimal point" in the advance options.
To learn more about calculations, you can check this guide: https://www.jotform.com/help/259-How-to-Perform-Calculation-in-the-Form
9. Now we want to pass that in our payment total field, to do that, you can check this guide: https://www.jotform.com/help/275-How-to-pass-a-calculation-to-a-payment-field
You can also use conditional logic to make your form smarter. Here's a guide that you can refer to: https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic
I hope that helps.