With formulas you can implement complex price calculations that go beyond simple surcharges. For very complex logic, full JavaScript code is also available.
Simple Formulas
Referencing Feature Values
[feature_name] → numeric value of the feature (for free input)
[feature_name.price] → surcharge of the selected option
[_base_price] → base price of the component
Basic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
^ Power
() Brackets for order of operations
Functions
ROUND(value, digits) → round to n decimal places
CEIL(value) → round up to whole number
FLOOR(value) → round down to whole number
MAX(a, b) → larger of the two values
MIN(a, b) → smaller of the two values
IF(condition, a, b) → if condition true → a, else → b
ABS(value) → absolute value (without sign)
Practical Examples
Area price (width × height):
[width] * [height] * 0.025
Area price with minimum price:
MAX([width] * [height] * 0.025, 49.00)
Rounded metre price:
CEIL([length] / 100) * 12.50
Quantity discount:
IF([quantity] >= 100, [quantity] * 8.90,
IF([quantity] >= 50, [quantity] * 9.50,
[quantity] * 10.90))
Combination of area and surcharges:
([width] * [height] * 0.020) + [colour.price] + [drive.price]
Advanced Calculations with JavaScript
When the simple formula syntax is not sufficient, you can use full JavaScript code. This allows arbitrarily complex calculation logic — loops, arrays, custom algorithms.
Basic Structure
The JavaScript code must return a numeric value at the end:
var area = width * height;
var base_price = area * 0.025;
// Minimum price
if (base_price < 49) {
base_price = 49;
}
// Return value
base_price;
Feature Values in JavaScript
All features are available as JavaScript variables — named after their internal name:
width // value of the "width" feature
height // value of the "height" feature
colour_price // surcharge of the selected colour
drive_price // surcharge of the selected drive
_base_price // base price of the component
Practical Examples
Complex quantity discount with table:
var tiers = [
{ from: 1, price: 10.90 },
{ from: 10, price: 9.50 },
{ from: 50, price: 8.90 },
{ from: 100, price: 7.90 }
];
var unit_price = tiers[0].price;
for (var i = 0; i < tiers.length; i++) {
if (quantity >= tiers[i].from) {
unit_price = tiers[i].price;
}
}
quantity * unit_price;
Price with rounding rules:
var area_m2 = (width / 100) * (height / 100);
var area_rounded = Math.ceil(area_m2 * 10) / 10;
var price_per_m2 = 45.00;
if (area_rounded > 5) price_per_m2 = 42.00;
if (area_rounded > 10) price_per_m2 = 38.00;
area_rounded * price_per_m2 + drive_price;
AI Agent for Formulas
The AI agent can create both simple formulas and JavaScript code:
"The price should be width times height times €0.025, but at least €49."
"I need a quantity discount: up to 10 units €10.90, from 10 units €9.50, from 50 units €8.90."