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’)
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.
- 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).