Contents
A formula lets the price depend on what the customer enters or picks. A customer types a length and a width, and the app multiplies them by your price per square meter and adds the result to the product price. You don't need a separate value or variant for every possible size.
You build the formula on the Calculations tab of an option set from these building blocks:
+, -, *, /, MAX, Round and so on;Then you choose what to do with the result: add it to the product price or subtract it from the product price.
Example. The formula Width * Length * 4.99 with Increase price $:
| Product price | Customer enters | Formula result | Price in the cart |
|---|---|---|---|
| $10.00 | Width 2, Length 3 | 2 × 3 × 4.99 = 29.94 | $10.00 + $29.94 = $39.94 |
Options
Below the editor, Available options lists the options of the set that you can use in the formula. Click an option to add it to the formula.
| Option type | What goes into the formula |
|---|---|
| Number field, where the customer enters a width, length and so on | The number the customer entered |
| Option where the customer picks a value (swatch, dropdown, buttons and so on) with Enable formula-based pricing turned on | The Calculation variable of the value the customer picked |
| Option where the customer picks a value without Enable formula-based pricing | Nothing in the calculation. It's marked · conditions only and can be used only inside a condition of an IF or IF…ELSE IF block |
| Product price, in the Product row | The price of the selected variant in Shopify, before any options are added. See Use the product price in a formula below |
Options of other types don't appear in Available options.
Math operators and functions