Shopping basket: Multiply by quantity selected

Want your customers to be able to select from different products and quantities in a shopping basket?

Branching and calculations is equipped with Multiply and Divide to help make life easier. You can also do calculations on Number questions, making a shopping basket easy-peasy to set up.

In this article, we’ll explain how to use these functions to create a checkout for a shopping cart that adds up the price based on the quantity of a single product that a customer selects.

Let customers choose how many items to buy

You can create a checkout that calculates the total price a customer needs to pay based on the quantity of a particular item they want. Check out this example we created using plane tickets, then read on to find out how we made it:

How to make it

1. Add a Picture Choice question that lists your items, each with a predefined price:

Screenshot 2024-04-17 at 15.52.30.png

Turn on Multiple selection in Question settings if you’d like people to choose more than one destination:

Screenshot 2024-04-17 at 15.55.46.png

This won’t change the following calculations!

2. Go to the Logic panel and select Branching and calculations. Click Add logic to start adding your calculations and add the corresponding amount to the price variable of each product.

Screenshot 2024-04-17 at 15.59.41.png

Warning! Make sure to choose Price (not Score)! You’ll need to add a Payment question to the typeform for this to appear as an option.

3. Add a follow-up Number question asking the user to confirm the quantity. You can use Recall Information to show the answer to question 1 and to display the chosen destination in the question:

Screenshot 2024-04-17 at 16.02.38.png

4. Now go back to the Logic panel, select Branching and calculations, and set up your calculations up to multiply the price variable by the answer to this question:

Screenshot 2024-04-17 at 16.05.51.png

5. Add a Payment question, and make sure you set the Price to 0 (zero):


And that’s it! Here’s what the final form looks like with a nice theme from the Design panel:

Screenshot 2024-04-17 at 16.10.17.png

Tap into our community knowledge