This extension adds a new type of field in the Form Fields settings.
Standard options are available for this field, like Label, Width, Text before, Text after, etc.
Amount Expression
This is the expression that will calculate the total amount.
You can mix dynamic fields with Tokens [form:field_ID]
or Elementor shortcodes [field id="field_ID"]
and static values grouped if needed inside brackets.
โ
If you would like, you could also insert multiple Javascript math methods, like Math.round() or similar.
Here are some examples:
[form:field_1] * 2 + 8
[form:field_1] * ([form:field_2] + [form:field_3])
(([form:field_1] * 3) + ([form:field_2] + [form:field_3])) * [form:field_4]
NOTE: All fields used in the formula MUST be numbers (integer or float).
Select and Radio could be used if you set a specific number for each option:
Red|1
Blue|2
Green|3
Use Amount in Actions
The Amount result will be available in email data and other actions, calling it with its Custom ID.
[form:my_total]
[field id="my_total"]
Amount Calculation in Frontend
On each change of the fields used in the formula, the total amount will be immediately updated.
It will be displayed as a disabled numeric input to avoid users' inappropriate manipulation.
Round Amount Field
You can round the amount field result to the desired precision.
Ternary Operator on Amount Field
You can use Ternary Operator to use the expression conditionally.
[form:number] > 10 ? [form:number] * 2 : [form:number] * 5
โ