Skip to content

Template: Hosting order form with discounts

Category: Order Form

Form Demo


Template Description


Key Features

  • The form gives a 10% discount for orders bigger than $100 and 30% when bigger than 150
  • The discount amount and percentage are displayed

Prerequisites

  • AIO Forms, you can download the plugin for free here.
  • Essentials Add-On needed to add and show the discount

How I created the hosting order form

This form is pretty easy to create, it is mostly just adding the fields you need. It has only two tricky points:

  • Configuring the price of the slider
  • Configuring the discount

Configuring the price of the slider

The hosting order form has two sliders so the users can define how much RAM and disk space they want.

If I wanted the price of the slider to be the same as the selected value (for example if they choose 4gb of RAM the plugin would add $4 to the grand total) this form would be easier, i would just need to go to the price typesetting of the slider and select "Current Value"

Setting the current value would make the price of the field the same as its value

But in this case, it is a little more complex. I want each RAM unit to cost .02 (so if they select 10gb of RAM the price is .3) to do that I did the following:

1.- In the price type of the slider I selected "Formula"

2.- I added the formula below

Formula to calculate the price of the disk storage field for the order hosting form

And that's it now the price of this field would be the same as its value multiplied by .03

Price per RAM example

Note: After finishing the form I noticed how ridiculously cheap these prices were and how I should have checked the prices on a real hosting site beforehand. But since I don't own a hosting company and this is just a demo form I decided to keep them.

Configuring the discount

The form will give a 10% discount for orders bigger than $100 and a 30% discount for orders bigger than $150

To accomplish this I did the following steps:

1.- Added a discount field to my form

Adding a discount field to the form

2.- In the discount type I selected 'Percentage' because I wanted to give a 10% discount and a 30% discount depending on the total price of the order.

Choosing a percentage discount type

3.- Now the discount field has a setting called "Value" where you can define the amount of discount to add. So for example if you select a "Percentage" discount type and in the value setting you select a 30, the field will always give a 30% discount

This configuration would always give a 30% discount

But in this case, I wanted to provide a 10% discount if the total price is greater than $100 and a 30% discount if it is greater than $150.

To do so I clicked on the calculator icon to define a formula.

Click on the calculator icon to define a formula

And then created this formula:

Discount formula

This formula might look complex but it is pretty easy to understand, this is what it does:

1.- Calculate the total cost of the form (by summing up the price of the sliders and checkbox fields)

2.- If the total is greater than 150 it returns a 30 (which means the field will give a 30% discount)

3.- If the total is greater than 100 it returns a 10 (which means the field will give a 10% discount)

4.- If any of the conditions above are met (meaning the total price is less than 100) it returns a 0 which means it doesn't give any discount

Lastly, I wanted to display both the amount discounted and its percentage to my users so I checked this box

Checking this box will make the field display both the amount discounted and the percentage

And, that's it! With this configuration now my discount field is ready to give discounts when I want it

My discount field is not applying the discount when I want it

Conclusion

Adding a discount is pretty easy to do using the discount field. With it, you can do from a basic fixed or percentage discount to advanced discounts using conditions or complex operations thanks to the formulas.

Template Download


Do you want to use this template in your own site? Click in the download template and import it into your site
Download Premium Template

Installation Instructions

You can download the template directly from here clicking in the button above and then import it to all in one forms

You don't have All in one forms?

You can get it HERE (there is a free version!)

Didn't fine the template that you need?

Sorry for that, our template gallery is pretty small right now but we are adding more templates constantly, remember that all the templates are 100% customizable so you could tweak one template to match your needs (everything is customizable using our drag and drop builder, no coding experience needed) or you can suggest one template in the Support portal