# Pricing & calculations

> Where prices come from, and the three ways to compute them — formulas, code, matrices.

Source: CBX documentation, version 4.0 preview (unreleased). Canonical page: https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/. Last updated 2026-08-02.

---
> **Audience:** store admins · **Scope:** everything that determines a configured product's price · **Last reviewed:** 2026-07-25

**TL;DR** — Simple pricing needs no formulas at all: a product **base price** plus a static
**price per answer**. When a price must *depend* on the configuration — area pricing, bracketed
rates, quantity effects — you build a **calculation** (a named, product-scoped formula) and attach
it to a question or answer. The customer always sees the resulting price live.

> **Platform note (Magento 2):** building prices **fully applies** on Magento-hosted stores, but
> **taxes and currencies come from Magento**, not from CBX screens — the configured price is
> calculated here and taxed by the Magento product's tax class. See
> [CBX on Magento 2](https://docs.configbox.at/docs/4.0-preview/admin-guide/magento2/).

## What can you build?

The three calculation styles cover just about any pricing scheme a configurable product needs —
and they compose, so one calculation can feed another:

- **Area & measure pricing** — price from what the customer types. The formula below charges
  €89/m² from the entered width and height, rounded to cents — built entirely by drag-and-drop:

  ![An area-price formula: Round((Width × Height) / 1,000,000 × 89, 2)](./img/calculation-formula.jpeg)

- **Bracketed price tables** — a matrix looks a price up from two inputs (question entries,
  selections or other calculations), with exact or next-higher/next-lower bracket matching —
  and you can paste the whole grid from a spreadsheet:

  ![A filled Width × Height price matrix with next-higher brackets](./img/calculation-matrix.jpeg)

- **Typed expressions** — the Code style for when logic beats dragging: conditions, thresholds,
  and the results of other calculations in one line (here: 5% off the glazing price for builds
  from 4 m width):

  ![A code expression chaining another calculation](./img/calculation-code.jpeg)

- Plus **quantity effects**, **per-customer-group math**, **recurring prices** and
  **weight-driven shipping** — each covered in its article below.

## Articles

1. **[Where prices come from](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/where-prices-come-from)** — the pricing building blocks and how
   they add up; read this before creating any calculation.
2. **[Build a calculation](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/build-a-calculation)** — the Formula editor, plus when to use the
   Code and Matrix styles instead.
3. **[Price with a matrix](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/price-with-a-matrix)** — the lookup table in depth: axes, brackets,
   spreadsheet import and multipliers.
4. **[Write a code expression](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/write-a-code-expression)** — the typed style: placeholders A–D,
   the full keyword reference and worked examples.
5. **[Charge recurring (subscription) prices](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/recurring-pricing)** — bill an answer or the
   product on a repeating cycle alongside the one-off price.
6. **[Set product weight for shipping](https://docs.configbox.at/docs/4.0-preview/admin-guide/pricing/weight-and-shipping-weight)** — the per-answer and
   product weight that weight-based shipping prices delivery from.

## The three calculation styles

Created under **Calculations** (each belongs to one product):

| Style | You author | Best for |
|---|---|---|
| **Formula** | drag-and-drop terms: numbers, question entries, other calculations, functions | readable arithmetic — most pricing |
| **Code** | a typed expression with placeholders and macros | quick math, totals-based surcharges |
| **Matrix** | a 2-D lookup table (importable from Excel) | "price depends on two inputs" tables |

All three produce a number from the current selections. You author in the **base currency** and
ignore tax — currency conversion, customer-group overrides and tax are applied automatically on
top of the result.
