Arithmetic expressions for Advanced Costs

Its possible to use arithmetic expressions, including fields shortcodes and simple mathematics operations at the Booking > Resources > Advanced cost page.

Its useful, when you are having checkbox (or selectbox), and want to apply some additional cost depend from selected option in other selectbox or checkbox in booking form.


1) For example, you are having increase of booking cost depend from visitors selection ( in N times),
and also you need to add 50 USD for a breakfast per each visitor, if some checkbox is selected.
Example of configuration fields in the booking form at the Booking > Settings > Form page:

</p>
<p>Visitors:  [select visitors "1" "2" "3" "4" "5"]</p>
<p>Breakfast (+50 USD):  [checkbox breakfast ""]</p>
<p>

In this case you can configure at the Booking > Resources > Advanced cost page for visitors option:

[visitors]
1 = 100%  of total booking cost
2 = 200%  of total booking cost
3 = 300%  of total booking cost
4 = 400%  of total booking cost
5 = 500%  of total booking cost

And for breakfast selection you can define expressions like this:
( [visitors] * 50 )

where [visitors] its shortcode of field from the Booking > Settings > Form page in "Content of booking fields data" form.


2) Shortcodes, its the names of form fields, from the "Content of booking fields data" form in Booking > Settings > Form page.
Each such shortcode will be replaced to digital number relative to selected option or checkbox.

3) In case, if the options in selectboxes or checkboxes does not have numbers (but some strings), please DO NOT use such shortcodes!
For example, if you have shortcode like this in booking form:

[select visitors "1" "2" "3" "4"]

so then you can use [visitors] shortcode at the Booking > Resources > Advanced cost page.

But if you are having shortcode like this at the Booking > Settings > Form page:

[select visitors "Person 1" " Person 2" " Person 3" " Person 4"]

so then you CAN NOT use shortcode [visitors] in the Booking > Resources > Advanced cost page.

4) Tip. The value of each selected checkbox = 1 and value of not checked checkbox is 0.

5) Please note, you need to use parentheses ( and ) to separate each mathematical operation.

Please use instead of expression like this

5 - 3 * 2
this expression
( 5 - ( 3 * 2 ) )
otherwise, the result will be 4 instead of correct -1

Supporting since update 8.2 in Booking Calendar Business Medium or higher versions.