Total Price Formula

Total Price Formula

Overview

The Unit price calculation / Total price calculation field (this section is titled Total Price Formula in the nav) is the main place you define how the line price is computed from options and base. You can also set minimum and maximum price caps and a calculator-level discount. Configure it in Calculator Editor → Options & Pricing → Total Price Formula.

If you leave the formula empty, the app still produces a price: see When the formula is empty below.

When the formula is empty

If the formula field is blank (no expression):

  • The runtime uses Initial Price (your calculator base—fixed or variant) plus the sum of each option’s priced contribution (each option’s evaluated formula × rate, for options that contribute to price).
  • Per unit granularity: that sum is treated as the unit price; quantity is applied afterward in the usual way.
  • Total granularity: that sum is treated as the line total for the configured quantity behavior.

After that intermediate price, the app still applies minimum / maximum price, total discount, fixed fees, and quantity discount rules as you configured them.

Use a non-empty formula when you want explicit control—for example VAR("BASE_PRICE") + OPT("A") + OPT("B"), or richer logic with IF(), TABLE(), and computed variables.

Stale compiled formula: If you previously had a formula and cleared it, save the calculator so the app does not reuse an old compiled graph. The editor normally clears this when the field is empty.

Steps

  1. Choose a price granularity mode: Per unit (the formula produces a per-unit price, multiplied by quantity) or Total (the formula produces a single total with quantity already factored in).
  2. Enter your price formula, or leave it empty to use base + sum of option prices automatically. Reference options with OPT("KEY"), OPT_TOKEN("KEY"), or INPUT("KEY"), the base with VAR("BASE_PRICE"), calculator variables with VAR("KEY"), Shopify values with VAR("SHOPIFY.PRICE"), etc., and tables with TABLE().
  3. Optionally set a minimum price and/or maximum price to cap the result.
  4. Optionally configure a total discount (see Details below).

Details

Setting Description
Price granularity Controls whether the formula is per-unit or a single total.
Price formula The main formula that computes the price.
Minimum price The lowest price allowed. Leave blank for no minimum.
Maximum price The highest price allowed. Leave blank for no maximum.
Discount type How the discount is calculated (fixed, percent, or formula-based).
Discount value / formula The discount amount, percentage, or formula depending on the type.

Total Discount

The discount section reduces the calculated price before it reaches the cart.

Discount Type Description
Fixed amount Subtract a fixed dollar amount from the total.
Percent Subtract a percentage of the total.
Calculated (amount) Use a formula to compute a dollar-amount discount.
Calculated (percent) Use a formula to compute a percentage discount.

Fixed fees are added after the total price formula is evaluated — you do not need to include them in your formula.

Examples

  • Per-unit area pricing — Granularity: Per unit. Formula: INPUT("WIDTH") * INPUT("HEIGHT") * TABLE("sqft_rates", OPT_TOKEN("MATERIAL")). Min: 10. The customer pays at least $10 per unit.
  • Bundled total with discount — Granularity: Total. Formula: VAR("AREA") * VAR("RATE") * OPT("QTY"). Discount type: Percent, Value: 10. Every order gets 10% off.