Formula based pricing Shopify: width × height, setup fees and rounding on the product page — without a variant for every combination.
2026-08-23

Formula based pricing Shopify: put the math on the product page

If you sell made-to-measure or print-to-size, the price already lives in a formula. Square metres times a rate. Length in millimetres times a cut fee. Base product plus gift wrap. Formula based pricing Shopify means that expression runs on the product page, updates as the customer types, and is the amount checkout actually charges. It does not mean inventing another Size/Color/Material variant for every cell in a spreadsheet.

Shopify’s native model is the opposite of an expression. A variant is a SKU with a fixed price. Adding variants still caps you at three options and 2048 variants (the old 100-variant ceiling was raised in October 2025 — see the changelog). That helps merchants with large but finite catalogues. It does not evaluate `width * height * rate`.

Developers run into the same wall. In How do I calculate product price based on dimensions in inputs? the storefront UI is done — two number fields, a live total — and checkout still bills the variant. The answer there is a Cart Transform (or an app that already ships one). Merchants without a custom app see the same gap in Custom product calculator: a pretty widget is not a payable price.

This article is a practical pass through formula based pricing Shopify: what the platform will not compute, how Options Price Calculator turns field keys into a numeric result, and how to keep rounding, metafields and Premium conditionals honest.

Why a bigger variant list is not a formula

Three options fill up fast. Colour, fabric and hem use the budget. A free-number width does not fit, and neither does a fourth finish. Even with 2048 slots you are enumerating outcomes, not defining a function. A customer who needs 137 × 89 cm is not “between two SKUs”; they are off the grid.

Community threads such as Product with variants that are linked to give a price describe the typical explosion: width and length must combine into a price, colour is only a note, and the matrix outgrows what you want to maintain. Line item properties can carry the colour. They do not change the price. We walked through that limit in line item properties do not change price.

So you have two jobs, not one:

  1. Collect inputs (numbers, choices, files) on the product page.

  2. Apply a formula to the cart line, not only to a `<span>` in the theme.

A Custom Liquid snippet that prints `width * height * 0.12` solves (1) and fails (2). Draft orders solve (2) and kill self-serve checkout. Formula based pricing is both jobs on one product template.

What the formula builder actually evaluates

Options Price Calculator is Built for Shopify. You add unlimited options without extra variants, write a formula, and the app updates the price the customer sees and the amount the cart charges. Setup is a theme app extension plus a calculator you link to a product or to a specific variant.

The formula builder is where the expression lives. You can type, paste, or insert variables from the field picker. The result must be a number. Supported operators are `+ − × ÷` and parentheses. Parentheses are not decoration — they fix evaluation order. A docs example:

``` (product_price + width * height) * material_multiplier ```

`product_price` is the price of the currently selected variant. Switch SKU and the base changes. Every field key from step 1 becomes a variable. Prefer the picker over hand-typed names; keys are case-sensitive and a typo fails the formula.

From Variables and Field Values:

| Source | What the formula sees | | --- | --- | | Number input | The customer’s number | | Dropdown / radio / swatch | The numeric value on the chosen option | | Checkbox | The configured value, or `0` when off | | File upload | Configured value × number of files | | Text / textarea | Optional float if text is present, else `0`; `{key}_chars` for per-character fees |

Math helpers (`Math.min`, `Math.max`, `Math.ceil`, `Math.floor`, `Math.round`) belong in the formula, not inside conditional *rules*. Round once, at the end.

Numeric metafields let one calculator serve many SKUs: `product_metafield__{namespace}__{key}` and `variant_metafield__{namespace}__{key}`. Store the rate on the product; keep the expression identical. Only integer or decimal metafields appear in the picker.

When the expression gets noisy, split it. Computed properties hold intermediates — surface area as `width * height` — and show up as `_cv_{slug}` in the main formula.

If/then logic is Premium: a floor price when the raw sum is under 100, or `width > 200` using a higher rate. That is Conditional Pricing, not the Starter formula editor. Live preview, font picker and the real-time price breakdown are Premium too. AI-assisted option and formula generation is on Starter and above.

Safety is not only CSS. Server-side price validation checks the calculated amount; the line item carries the options into the order and, if you enable it, into the confirmation email.

A worked example: vinyl banner, not a 400-row dropdown

Print shops usually already know the rule: area × material rate + setup. Encoding that as variants means every width step × every height step × vinyl/mesh. In the calculator you add two number fields (`width`, `height` — pick cm or m and convert in the formula if needed), a dropdown `material_type` with `1` and `1.2`, and a setup constant.

From the official pricing examples:

``` product_price + 25 + (width * height) ```

Add the multiplier and round for storefront currency:

``` Math.round((product_price + 25 + (width * height * 12 * material_type)) * 100) / 100 ```

Cleaner: a computed property for area, then reuse `_cv_area` in the main line. A rush checkbox with value `40` is just `+ rush`. A file-upload field with value `15` adds only when artwork is attached.

The same shape covers fabric by the metre (`product_price * meters`), cut-to-length metal (`length_mm * rate + kerf`), or engraving (`product_price + engraving`). We already covered price per square metre as a use case. This piece is the expression: operators, keys, rounding, metafields.

Keep real inventory on variants. Link a different calculator per variant when wood and metal use different maths (linking docs). One variant, one calculator.

Ship it on one product first

  1. Install Options Price Calculator. Free: 20 uses (always free on a Shopify Develop plan). Starter is $9.99/month for unlimited options, the formula builder, metafields, AI, styling and multilingual labels. Premium is $14.99/month for conditional logic, font picker, live preview and price breakdown. The listing is 5.0 from 22 reviews.

  2. Add the theme app block: Online Store → Themes → Customize → Products → Default product → Add block → Apps. Place it below the price and above Add to cart. Themes differ; the selector picker exists so you can bind the price node and the cart button when the default hook is not enough.

  3. Name field keys in lowercase (`width`, `height`, `material_type`). Give each choice a float.

  4. Write one formula. Use the builder preview, then the live product page. Confirm the cart line matches the on-page total.

  5. Link the calculator. Prefer a numeric metafield for the rate if you will reuse the same expression on dozens of SKUs.

Dynamic product options are the UI layer — swatches, uploads, checkboxes. Formula based pricing is the arithmetic behind them. Do not rebuild the catalogue on day one. Prove the sum on a single SKU.

Wrap-up

Formula based pricing Shopify is your real rule on the product page — `product_price + (width * height)`, setup, multipliers, rounding — with the same number in checkout. Native Shopify stops at three options and a price per SKU. Put the expression in Options Price Calculator and let customers see the math before they email you for a quote.

online origins logo full

Custom webshops, websites, and applications combined with smart online marketing to help your business grow online!

linkedin online origins iconinstagram online origins icon

Reviews

5/5

Check on Google

Mail: info@onlineorigins.nl

Tel: 073 234 0612

KVK: 89825624

BTW: NL865123639B01

Bruistensingel 500,
5232 AH 's-Hertogenbosch
Cookies

© 2026 Online Origins