Use Custom Calculations

To use a custom calculation instead of a static price of an item, edit this item and activate the option “Use custom calculation“. 
You will see the custom calculation panel :

The calculation code uses Javascript, you can use any javascript function inside. The result of the calculation filled in the field will define the price of the current item.
If the item uses quantities, this result price will be multiplied by the selected quantity.

Above the calculation field, you can see 3 buttons :

  • Add a value : this button allows you to easily recover the value of any item in your form. Simply click the button, select the desired item and the wanted attribute (price, quantity …) and press the “Insert” button. You will see the generated code directly in the calculation field.
  • Add a condition : clicking this button, you can visually define conditions (as on a link) using the items of your form. The generated code of the condition will be added in the calculation field at end. The calculation you will add between the two “{” and “}” of the created condition will be used in calculation only if the condition is filled.
  • Add a distance : this button will be enabled only if you filled the “Google Maps browser key” (in the “General” tab of the form) is filled. Clicking this button, you can add a distance depending on different textfields of your form (addresses, cities, countries …) to your custom calculation. More information at point 3.2 .

The 4 usual calculation operators are + (add up),  (subtract), * (multiply) and / (divide) .

Example of calculation :