- Increase Value by Percentage
- Decrease Value by Percentage
- Sum Fields
- Fields Difference
- Multiple Fields
- Custom Callback
You can perform desired mathematical problems using the JetEngine Dynamic Field and Calculated Callback add-on.
The initial step is activating the callback add-on from the JetEngine plugin. Follow the link and copy the code.
Go to the Appearance > Theme Editor directory. Click on the Theme functions tab of your active WordPress theme and paste the code you have copied earlier.
Push the “Update File” button.

Proceed to the page where you want to place the Dynamic Field. For instance, we will open a listing template. You can also use a single or an archive template.
Add a Dynamic Field if you haven’t done it yet.
We choose “Meta Data” as the Source and the “Price per 1 day/night” option in the newly appeared Meta Field.

Scroll down to the Filter Field Output toggle and activate it.
In the Callback drop-down menu, select the “Calculated field” option.
Pick the desired callback in the Calculated callbacks field.
Increase Value by Percentage
When this value is chosen, set the desired percent in the Additional arguments field, and the result will be counted and displayed straight away.

Decrease Value by Percentage
This time, value input in the Additional arguments field will be subtracted from the meta field value.

Sum Fields
In the Additional arguments field, paste the Meta Field Key of the field you want to sum with the meta field you have chosen as the Dynamic Field source.

Fields Difference
Subtract the desired value from the editable dynamic field. To do so, paste the required Meta Field Key in the Additional arguments field.

Multiple Fields
Fill in the Additional arguments field with the meta field you want to use as the second source for multiplication.
As you can see, now the default price has been multiplied by eight.

Custom Callback
Besides, you can also set a custom callback. The example you can find by following this link.

Head to Appearance > Theme Editor and paste the code in the Theme Functions of your active WordPress theme.
You can change the name of your callback by typing it instead of the ‘custom_callback’ value.
Moreover, mind altering the ‘guests-number’ into the meta field you want to use as an additional arithmetical value.
In our case, the result will be calculated based on the number of guests. Depending on whether there are fewer or more guests than 10, the formula will change.
You can also change any needed calculation conditions. Push the “Update File” button once the code is ready.

Move to the template you want to edit and scroll down to Filter field output. Enable this toggle and select the “Calculated field” from the Callback drop-down menu.
Pick the created custom callback among the available options in the Calculated Callbacks. Once done, the price of the custom post will already be calculated.
In this case, this part of the formula works:
elseif ( 5 <= $additional_field_value && $additional_field_value < 10 ) {
$result = $field_value * $additional_field_value - $field_value * $additional_field_value * 0.1;

Besides, you can use the Customize field output feature. Type the desired characters before and/or after the “%s” sign.

Whenever you are ready, click on the “Publish/Update” button to save the changes and head to the page you want to place the listing.
Place the Listing Grid widget on the page. Select Listing you have just created.

Once all the Listing Grid settings are adjusted, click on the “Publish/Update” button. Let’s check the result.

Everything works fine. The price is calculated depending on the number of guests, price entered in the custom post type meta fields, and formula pasted in the Theme Editor.
Now you know how to use the Calculated Callback add-on by the JetEngine plugin.