How to calculate a price right in the form
← BackAdd a field of type “Calculator” and enter the “Calculation formula” — in it you can reference other fields in curly braces.
- Add a field and select the “Calculator” type.
- In the “Calculation formula” field, write an expression. Names of other fields are inserted via buttons from the “Insert field:” row — they're substituted in curly braces:
{Print run} * {Price}. - Save. The result recalculates as soon as the visitor changes any field in the formula.
What the formula language can do:
- arithmetic
+ - * / ( ), decimals written with a comma or dot; - conditions:
If … then … ElseIf … then … Else … EndIf; - comparisons
= <> < > <= >=andCONTAINS, logicAND,OR,NOT; - functions (arguments separated by semicolons):
ROUND(x; digits),ROUNDUP,ROUNDDOWN,INT,MIN,MAX,ABS,SQRT,POWER(x; y),COUNT; - multiple choice:
{Options} CONTAINS "Lamination"andCOUNT({Options}); - comment — two slashes to the end of the line.
The full language reference is in the field window itself, below the formula — “Formula language reference”.
If it didn't work
- The result is empty. Most likely the formula contains a field the visitor hasn't filled in yet. Set a “Default value” for such fields.
- The field name in the formula doesn't work. Insert it with the button, not manually: the name must match the field name letter for letter.
- You renamed a field — the formula broke. Fix the formula: it references the name.
Did the article help?
Thank you, we've recorded it.
See also
How to build a formCreate a section with the forms module and click “Add field” — fields are laid out by dragging across columns.What field types are thereMore than thirty types in five groups: from a plain string and a date to a calculator, a set of services with prices, and choice buttons.How to set field width and unit of measurement"Width within column" stretches the field, "Unit of measurement" labels it — "pcs", "m²", "rub", or your own option.How to transfer a form to another siteThe "Download form" button saves it as a file, "Upload form" deploys it in another section.
In the help section, you will find answers to frequently asked questions and useful instructions for working with the Site Look website builder. Here you can learn how to manage sections, add objects, and configure the website. The materials will be useful for both beginners and experienced users. If you haven't found an answer, contact support.
