Signup

Create an order form and shopping basket with Branching and calculations

You can design your own custom shopping experience with Typeform by combining Calculations and integrated Stripe payments (the Payment question).

Your customers make their selections, the ‘Price’ variable increases or decreases depending on their selections, and the Payment question is automatically ready with the right price at checkout.

You can read more about order forms, and try out our ready-made example typeforms here.

Here’s an example typeform with a shopping basket:

And this is what the Branching and calculations settings look like from the example above:

Shopping_basket_1.png

HC_Warning_ilu_cropped.png
Warning! Note that the Price variable will not be visible until you add a Payment question to your typeform!

Setting an initial value for the Price variable

Before any questions have been answered, the Price variable can be given an initial value.

The initial value would be 0 (zero) if you want to do a straightforward shopping cart which adds up the total price for all items selected. But you can also use Calculator to apply a discount, for example, decreasing the price from its initial value. You could also use this option to apply a delivery charge, if you like.

You can set the initial value for the Price variable on the Question settings screen for the Payment field:

Screen_Shot_2021-06-08_at_5.17.06_PM.png

Let customers choose quantity

Use a Number question to ask your customers for quantity, and then let Branching and calculations work out the total price.

1. Add a Number question, and write your text:

Screen_Shot_2021-06-08_at_5.17.56_PM.png

2. Then go to the Logic panel, select Branching and calculations, and set up the Logic like this:

Screen_Shot_2021-06-08_at_5.19.38_PM.png

Choose Multiply from the dropdown menu, so that whatever number customers answer, the total price is multiplied by that amount.

Discount coupons

Let’s say you’re selling an eBook which retails for $9, and you want to enable the coupon code “earlybird” which will reduce the price by $2 to $7. Once set up, people need to enter a coupon code that exactly matches this otherwise the price reduction won’t be applied.

Discount coupons can be set up by using Branching and calculations with a Short text field, like so:

Screen_Shot_2021-06-08_at_5.22.16_PM.png

You can also create coupons with percentage discounts by multiplying the price variable. For example, to give a 10% discount, you have to multiple the price by 0.9, for a 20% discount by 0.8, and so on:

Screen_Shot_2022-04-11_at_3.51.38_PM.png

 

Tap into our community knowledge