Conditional Pricing (Premium)

Written By Floris de Vries

Last updated 3 days ago

Premium featureConditional formulas are available on premium plans.

Conditional formulas allow you to apply if / then / else logic to your pricing. This makes it possible to calculate prices differently based on customer input, thresholds, or selected options.


What are conditional formulas?

A conditional formula evaluates one or more conditions and applies a formula only when those conditions are met.If none of the conditions match, a default (else) formula is used.

This allows you to create advanced pricing rules such as:

  • Tiered pricing

  • Surcharges above certain values

  • Minimum or maximum pricing

  • Option-based logic


Structure of a conditional formula

A conditional formula consists of:

  1. One or more conditions

  2. A Then formula (applied when the condition is true)

  3. An Else (default) formula (applied when no conditions match)

Conditions are evaluated from top to bottom; the first matching branch wins.


Conditions

Each condition is built using variables, comparison operators, and optional logical operators.

Available comparison operators

  • is greater than

  • is less than

  • is greater or equal

  • is less or equal

  • is equal to

  • is not equal to

Logical operators

  • AND (all must be true) โ€“ all comparisons must be true for the condition to match.

  • OR (at least one true) โ€“ at least one comparison must be true for the condition to match.

Variables in conditions

Conditions can reference:

  • Form field values (from Step 1)

  • {key}_optidx for Dropdown, Radio, Swatch, Font and Color fields โ€“ zero-based index of the selected option (only available in conditions, not in the regular formula)

  • Product price and numeric metafields

  • Computed properties (custom variables)

  • TRUE and FALSE constants for comparing checkbox-style booleans

Example:

width > 200 AND height > 150

Then formula

The Then formula defines the price calculation that is applied when the condition is true.

The same rules apply as for regular formulas:

  • Must return a numeric value

  • Can use all formula variables, including computed properties, lookup tables (lookup2d), and math helpers (Math.min, Math.max, Math.ceil, Math.floor, Math.round)

Example:

(product_price + area * 1.2)

Else (default) formula

The Else formula is applied when none of the conditions match.

This formula is required and acts as a fallback to ensure a price is always calculated.

Example:

product_price + area

Per-branch variable overrides

Each condition branch can override the value of a computed property (custom variable). The same variable name then resolves to a different formula depending on which branch matched.

This is useful for things like:

  • A Discount variable that is 0 by default but price * 0.10 for VIP customers.

  • A Surcharge that depends on a size threshold.

The override only applies inside the matching branch; outside the branch the variable falls back to its base formula.


Multiple conditions

You can add multiple conditions using Add condition. Important behavior:

  • Conditions are evaluated in order

  • The first matching condition is applied

  • Remaining conditions are ignored

This allows you to create tiered logic such as:

  1. Large size pricing

  2. Medium size pricing

  3. Default pricing


Switching between formula modes

In the 4c. Formula tab you can switch between Single formula and Conditional formulas (Premium). Switching back to a single formula disables conditional logic and uses one formula for all cases.


Common use cases

  • Higher price for large dimensions

  • Extra fee when a specific option is selected

  • Minimum price enforcement

  • Different pricing per quantity range

  • Customer-tag based discounts via per-branch variable overrides


Best practices

  • Keep conditions simple and readable

  • Avoid overlapping condition ranges

  • Always define a safe default formula

  • Test with realistic values using preview mode


๐Ÿ’ก Tip:If your pricing logic starts to feel complex, conditional formulas combined with computed properties keep calculations readable and maintainable.