A Gen Product Options
Menu
Tutorial · Made to measure

Custom size price calculator for Shopify (width × height)

Charge by size: width and height fields feed a price formula, with a minimum charge.

UsesNumberPrice formula

Made to measure

Price calculator

Steps
3 steps
Checks
3 things to try
Docs
3 reference pages

Quick answer

Add two required Number options, Width (cm) and Height (cm), with the sizes you can make as their limits. Then add a Price formula option with max(15, {Width (cm)} * {Height (cm)} * 0.02). A 50 × 70 cm print adds $70.00, a 20 × 20 cm print adds the $15.00 minimum, and checkout charges the same.

Last updated

You'll sell a custom-size print priced by area. The shopper types a width and a height in centimeters, and a Price formula adds 0.02 per square centimeter, with a minimum of $15. Set the product's own price to the base cost (for example the frame), since the formula is added on top.

What you’ll build

Live preview: Width 50 and Height 70 cm give a Size price of +$70.00, so the price shows $190.00
50 × 70 cm adds a $70.00 size price.
  1. Step 1: Add the size fields

    1. Click Add option, choose Number. Label: “Width (cm)”. Min value 20, Max value 150, Step 1. Turn Required on.
    2. Add another Number: “Height (cm)”, with the same limits and Required on.
    3. Optional: set both to Width Half (2 per row) so they sit side by side.

    Checkout keeps typed numbers inside Min value and Max value, so set them to the sizes you can make.

  2. Step 2: Add the price formula

    1. Click Add option and choose Price formula. Label: “Size price”.
    2. In Formula, type max(15, {Width (cm)} * {Height (cm)} * 0.02). Start typing an option name and pick it from the list to get the braces right.
    3. Use Try it: enter 50 and 70 and check that it adds $70.00 (50 × 70 × 0.02).
    max(15, {Width (cm)} * {Height (cm)} * 0.02)
    0.02 per cm², at least 15.
  3. Step 3: Activate and save

    1. Set Status to Active, apply the set to your print products and click Save.

After you save

Check it on your store

  • With only one size filled in, the formula adds nothing: it needs every number it uses.
  • Enter 50 × 70: the price goes up by $70.00. Enter 20 × 20: it goes up by the $15.00 minimum.
  • At checkout, the line costs the product price plus the formula amount.

Stuck on something?

Check Troubleshooting, or email us with your store URL and we’ll help.

Email support
More recipes

Try another recipe.