Did you know that you can use the number of selected products in conditional logic? You can!
How do I do this?
On any question, break, email or integration conditional logic setup, just select the product question, then in the same dropdown, there will be more options available to select on the total quantity of all products in this question, or the quantity of individual products.
After selecting the desired quantity, you can continue and set up the logic like you would any other rule.
So what can I use this for?
This comes in handy for lots of use-cases like:
- Selling tickets and conditionally capturing information on the number of selected tickets.
- Configuring selected products (e.g. the size and color of t-shirts).
For a more in-depth guide, let's say we're selling some merchandise for our band, t-shirts, beanies and hoodies.
When the submitter chooses "T-Shirts", we want to off a few different customization options to them for each of the t-shirts they want to order.
1. The first step is that we need to restrict the number of T-Shirts the customer can order. We'll be creating a set of questions to be used for each of the selected t-shirts, so we can't let the customer choose 1,000 T-Shirts (unless you want to create 1,000 groups of questions...). For this example, we have set the maximum number of T-shirts per submission to 5 (pictured below).
2. Add a "break" to the form, and configure it to be visible when the selected product quantity is more than 0.
More than 0 simply means that the content in this section will only be used when there is atleast 1 t-shirt selected.
3. Beneath this break, add the questions that you would like to ask when the customer has selected 1 T-Shirt.
4. When you're happy with the set of questions, duplicate the group of questions multiple times until there is one group of questions for each t-shirt.
5. Above the second group of questions, insert another break, like the break we created in Step 2, except we want the rule to be when T-Shirts Quantity is greater than 1. Repeat this for all of the rest of the question groups, so that there is a break above them configured to only show them when the quantity is correct.
6. You're done!
Side notes/Hot tips.
- Depending on your needs, the breaks can either be full page breaks, or inline sections that display on the same page.
- It's helpful, at least while setting up, to write some text above each question group so you can quickly identify what number you're up to.
- If you don't care which product is selected, you can use the same kind of logic, but on the "Total Quantity" which sums up all of the selected products in the product question.
- If you are using section breaks (showing the content on the same page, not on a new page), make sure you add a section break after all of the product related questions that is always visible if you have different questions or content that you would like to be visible on the same page.