Skip to main content
Calculator Settings

Prefill calculator fields via URL

Pass field values in the product page URL so the calculator fills and recalculates automatically.

Written By Floris de Vries

Last updated 1 day ago

You can open a product page with calculator fields already filled by adding query parameters to the URL. The calculator treats those values as if the customer entered them by hand and recalculates the price.

This is useful when another tool (for example a configurator or 3D builder) should hand the customer off to your Shopify product with measurements or options already set.


How it works

  1. Use the field Key (unique ID) as the query parameter name.

  2. Add the value after =.

  3. Open the product URL that already has the Options Price Calculator attached.

Example:

https://your-store.com/products/custom-blinds?field_1=1200&materiaal=option_1

In this example:

  • field_1=1200 fills a number field whose key is field_1

  • materiaal=option_1 selects a dropdown option (see matching rules below)


Which fields can be prefilled

Supported:

  • Number

  • Text / textarea

  • Checkbox

  • Dropdown, radio, swatch

  • Colour only when it uses an options list

Not supported (ignored safely):

  • File uploads

  • Font fields

  • Colour pickers / RAL

  • Calculated displays

  • Price or cart properties (you cannot set the final price via the URL)


How values are matched

Numbers

Invalid numbers are ignored. Values outside the field min/max are clamped to the allowed range.

Checkboxes

Use true / 1 / yes / on to check, or false / 0 / no / off to uncheck.

The app tries, in order:

  1. Exact option value

  2. A slug of the option label (recommended when options have no value): spaces and symbols become underscores, lowercase — for example Option 1 → option_1

  3. Exact option label (case-insensitive)

If nothing matches, that parameter is ignored. Unknown keys are also ignored.


Requirements

  • The product must use this calculator form

  • Query names must match field keys exactly

  • Hidden fields (conditional field visibility) are not filled

  • If Keep field values when the customer changes variant is also enabled, URL values still win on first load for matching keys


What this is not

There is no public JavaScript API to set fields and check out without the product page. URL prefilling lands the customer on the product with values filled; they still use Add to cart / checkout as usual.


💡 Tip: Find each field’s key in Step 1: Form fields in the calculator builder.

Was this helpful?

Still need help? Ask the team