The Basics
This page will explain how the calculation system works in ez Form Calculator for WordPress. The plugin allows you to add element values, subtract, multiply, divide and many more math operations with ease.
The plugin works like this:
 Element values are calculated automatically
 Values are added up from top to bottom
 Some elements might contain calculation rows (e.g. multiply with other elements)
 All calculation elements might overwrite the price from where it’s positioned (if the option ‘overwrite_price’ is set to ‘Yes’)
In general, there are many ways to set up a form. The most common ones are described below.
Default Calculation
Elements are calculated from top to bottom, so every element is added consecutively. For example, a simple order consists of only Numbers elements. The calculation is handled like this:
 Product A: 15  Price = 15
 Product B: 20  Price = 35
 Product C: 10  Price = 45
 Price = 45
Advanced Calculation with Subtotal Elements
Complex calculation forms can be realized with the help of Subtotal elements. This way, multiple calculations can be created in a single form.
 Product A: 5
 Product B: 10
 Width: 100
 Height: 70
 Subtotal 1:
 Calculation: Product A * Product B = 5 * 10 = 50
 Subtotal 2:
 Calculation: Width * Height = 100 * 70 = 7000
 Subtotal 3:
 Calculation: Subtotal 1 + Subtotal 2 = 50 + 7000 = 7500
 Price = 7500
This article shows how math operators are used in the plugin.
The Flow
The following flowchart shows how the user input is processed by the plugin.
First, the (user) input is registered and the calculations of all elements in the form are processed. The “Calculate” section in the element options are run from top to bottom.
Afterward, the discount section is processed. Every row in the discount section will be checked if the calculated value of the element should be modified, for example, set a fixed value, increase value by a fixed percentage, modify the factor and so on.
Subsequently, the conditional section is processed. Depending on the value of the current element, the plugin will perform conditional actions, if all conditions are met.
Width * Height Calculation
The following form calculates the total square metres of the width and height element.
In this form, there are two Numbers elements called Width and Height as well as an additional Subtotal element called Area. Both Width and Height can be changed by the user whereas the Subtotal element calculates the area.
In order to see the calculation behind the form, click on the Area element and move to the section Calculation. The calculation rows are responsible for the area calculation.
 First, the Subtotal element retrieves the value of the Width element (let’s say the value is 10)
 Subsequently, the current value will be multiplied by the Height element (let’s say 5)
 The final calculation is 10 * 5 = 50
 Form

The following form calculates the total square metres of the width and height element.
Loading...  How does it work?

In this form, there are two Numbers elements called Width and Height as well as an additional Subtotal element called Area. Both Width and Height can be changed by the user whereas the Subtotal element calculates the area.
In order to see the calculation behind the form, click on the Area element and move to the section Calculation. The calculation rows are responsible for the area calculation.
 First, the Subtotal element retrieves the value of the Width element (let’s say the value is 10)
 Subsequently, the current value will be multiplied by the Height element (let’s say 5)
 The final calculation is 10 * 5 = 50
 Download
Calculating with Target Values
First, you must determine which value to retrieve since there are multiple ways to do this. The most common ones are 1) Raw value and 4) Calculated target value without subtotal.
 Raw value
 This will retrieve the “raw” target element’s value, i.e. the value which is displayed in the input field
 If there is a factor defined in the target element, the retrieved value will be multiplied with the factor.
 Raw value without factor
 The same as #1 but this time, the value will ignore any factor.
 Calculated target value with subtotal
 Elements like Numbers, Dropdowns etc. where calculation rows are possible will not show the calculated value in the input field
 This option will retrieve the calculated target value with its subtotal value (i.e. the price of the current position + the calculated value)
 Calculated target value without subtotal
 The same as #3 but this time, the subtotal value will not be added to the calculated value
Generally, you can almost always use the 1) Raw value from Subtotals since these elements update their input field immediately. Other elements such as Numbers, Dropdowns etc. where any calculation row is present should be retrieved with 4) Calculated value without subtotal.
Note: do not use 3) or 4) in the same element since this will result in an infinite loop.
Description in “Form” tab. Please note that this section is available since v2.9.8.0
 Form

First, you must determine which value to retrieve since there are multiple ways to do this. The most common ones are 1) Raw value and 4) Calculated target value without subtotal.
 Raw value
 This will retrieve the “raw” target element’s value, i.e. the value which is displayed in the input field
 If there is a factor defined in the target element, the retrieved value will be multiplied with the factor.
 Raw value without factor
 The same as #1 but this time, the value will ignore any factor.
 Calculated target value with subtotal
 Elements like Numbers, Dropdowns etc. where calculation rows are possible will not show the calculated value in the input field
 This option will retrieve the calculated target value with its subtotal value (i.e. the price of the current position + the calculated value)
 Calculated target value without subtotal
 The same as #3 but this time, the subtotal value will not be added to the calculated value
Generally, you can almost always use the 1) Raw value from Subtotals since these elements update their input field immediately. Other elements such as Numbers, Dropdowns etc. where any calculation row is present should be retrieved with 4) Calculated value without subtotal.
Note: do not use 3) or 4) in the same element since this will result in an infinite loop.
Loading...  Raw value
 How does it work?

Description in “Form” tab. Please note that this section is available since v2.9.8.0
 Download
Nested Calculation
Please note that this section is available since v2.9.9.0
Nested calculations require open and closing brackets which you can find in the target element dropdown in the calculation section. This way, you don’t need to use placeholders anymore.
If you look at the following screenshot, you can see that calculation rows are indented. This is only necessary for open and closing brackets though you can understand better how the element is calculated.
Make sure that paired open and closing brackets have the same priority or the element will not calculate correctly. You can increase / decrease priority with the left and right arrow buttons in the calculation section.
 Form

Loading...
 How does it work?

Please note that this section is available since v2.9.9.0
Nested calculations require open and closing brackets which you can find in the target element dropdown in the calculation section. This way, you don’t need to use placeholders anymore.
If you look at the following screenshot, you can see that calculation rows are indented. This is only necessary for open and closing brackets though you can understand better how the element is calculated.
Make sure that paired open and closing brackets have the same priority or the element will not calculate correctly. You can increase / decrease priority with the left and right arrow buttons in the calculation section.
 Download
Side Notes
 Make sure that the option “overwrite_price” in the quantity elements are set to “Yes”. Otherwise, the calculated value will be added, which is wrong for this purpose.
 Calculations may be wrong when using conditionally hidden subtotal values in the first row. In order to avoid this, simply set the first calculation row to “0” (equals / no target / 0).