Using the Formula Builder
Written By Floris de Vries
Last updated 2 days ago
The Formula Builder is where you define how the final price is calculated. It allows you to write mathematical formulas using field values, product prices, and helper functions.
Formula editor
You can create formulas by:
Typing directly into the editor
Inserting variables using the field selector
Pasting formulas from elsewhere
All formulas must result in a numeric value.
Supported operators
The following mathematical operators are supported:
+Addition-SubtractionรMultiplicationรทDivision( )Parentheses
Parentheses are strongly recommended to control calculation order and avoid unexpected results.
Field selector
The Form fields dropdown allows you to insert available variables directly into the formula.
This includes:
All fields created in Step 1
Product and variant metafields
Rounding functions
Using the selector reduces typing errors and ensures valid variable names.
Writing clear formulas
Best practices for writing formulas:
Use parentheses to group calculations
Keep formulas readable and structured
Apply rounding at the end of the formula
Avoid unnecessary complexity
Example
(product_price + width * height) * material_multiplierConditional formulas (Premium)
For advanced pricing logic, you can switch to conditional formulas. This allows you to apply different formulas based on conditions such as size thresholds or selected options.
Learn more โ Conditional Pricing (Premium)
๐ก Tip:
If a formula becomes difficult to read, consider splitting logic into simpler steps or using conditional formulas.