# Document – Elementor forms – Cost Calculator

With the Elementor Forms Cost Calculator, you can create dynamic and interactive forms that provide users with instant cost calculations or estimates. This is particularly useful for businesses or websites that offer products or services with variable pricing based on user selections or quantities.

Here are some key features and capabilities typically offered by the Elementor Forms Cost Calculator:

1. Calculation Fields: This extension introduces calculation fields into your Elementor Forms forms. You can define these fields and specify mathematical formulas or expressions using variables and operators.
2. Variable Inputs: Users can input values into the form, such as quantities, dimensions, or other parameters that affect the final cost calculation.
3. Conditional Logic: The plugin allows you to incorporate conditional logic into the calculations. This means that you can set up different calculations based on specific conditions or user choices.
4. Dynamic Updates: As users make changes or update input values, the cost calculation is automatically updated in real-time, providing instant feedback.
5. Customizable Output: You can customize the display and formatting of the calculated cost or estimate. This might include adding currency symbols, decimal places, or any additional text.
6. Integration with Elementor Forms: The extension seamlessly integrates with the Elementor Forms plugin, allowing you to leverage its form-building capabilities while adding cost calculation functionality.

### Installation – top

Ensure you installed and activated the plugin.

### Calculation settings

Create a new form – Drop down a field – Choose type Calculator for settings.

when you enter, suggested functions will appear.

Switch on “Yes”.

#### IF Condition

Logical operators (==, !=, <, <, >=, <=) are supported, but logically they can only return true (1) or false (0). In order to leverage them, use the built-in if function:

✔️ One condition:

``````if(condition,true,false)
``````

E.g: If (A>B, 100, 10)

Have a result:

✔️ Two conditions:

``if(if( condition, true, if( condition, true, false))``

E.g: Calculate the entrance fee to the zoo park:
Children under 10 years old receive a 50% discount, persons over 70 years old receive a free, and everyone else pays the exact original price.

• Step 1: Drop down fields: Original Fee (type:number), Age(type:number slider), Final Fee(type:calculator)
• Step 2: Set formula:
``if(field_d060d05 <10, field_6922ee0*0.5, if( field_d060d05>=70,0, field_6922ee0))``

Where:

field_d060d05: ID of Age

field_6922ee0: ID of Original Fee

• Step 3: Save and Have a preview:

#### Date/ Month/ Year calculations

``````days( end, start)
months( end, start)
years( end, start)
``````

end: copy & paste ID of Date B

start: copy & paste ID of Date A

E.g:

#### Age calculation

Method 1: Based on Date of Birth to present

E.g:

• Step 1: Drop down fields: Date of Birth (type:date) and Age (type: calculator).
• Step 2: Set formula:
``Age(birthday)``

Where:

birthday: ID of Date of Birth ( when you click on Date of Birth field and continually click on Advanced tag, it is displayed.

• Step 3: Save and have a look!

Method 2: Based on date of birth until a given date.

• Step 1: Drop down fields: Date of Birth (type:date), Given Date(type:date) and Age (type: calculator).
• Step 2: Set formula:
``age2(birthday,field_2f377d6)``

Where:

birthday: ID of Date of Birth

field_2f377d6: ID of Given Date

• Step 3: Save and have a look!

#### BMI Calculator

E.g:

• Step 1: Create fields: Weight(type:number), Height(type:number), BMI Calculator(type:calculator)
• Step 2: Set formula:
``field_d953e95/(field_c6d91bb*field_c6d91bb)``

where

field_d953e95: ID of Weight

field_c6d91bb: ID of Height

• Step 3: Please have a preview: