Creating an order form that support an unlimited amount of products is very easy to do thanks to the repeater field, in this tutorial we are going to show you how to do use it:
- Add all the fields that you want, like customer name, email etc. Leave the fields related to the product (like product name and quantity) to the end.
- Add a repeater field (You can find this field under the “Field Container” section)
- Add all the orders fields inside the repeater, for this example I just want to use a dropdown to put my list of products there, a quantity box and a total.
- Configure the price calculation (Check this tutorial for more info about this)
Each product in my dropdown is going to have a different price so I am going to set the price to this field as “Options”
I will also define a price for each option
My “Quantity” field should act (like it’s name suggest) as quantity modifier, so the price of my product is multiplied by the quantity defined in this field. To do so I will set the price type of this field as “Quantity”
Lastly my total field will just display the total of each ordered product
With this configuration now I have a fully functional form that do the calculations as i want them
But I would like to also show a Grant Total at the end so I will just add another “Total” field bellow the repeater, this total field will display the grant total (which is the sum of all the ordered products). You can find the total field under the display section
And that’s it, now I have a fully working order form that shows a total per line and a grand total.
You can see a little modified version of this form (I just added more customer information fields but the repeater logic is exactly the same) in action in the templates page feel free to download the template from there, you can even log in as administrator and view the form configuration directly inside that site.
About the Author:Im programmer working for an international company. I have programmed since i was 12 and i have done it professionally for 6 years. Programming for a company is fun and i have learned a lot of things but i have always been interested in running my own business so i decided to give it a shot doing what i do best, programming stuffs.