Calculator on the product page
Published 3 days ago
The Calculator block adds a button to the product page that opens a calculator in a dialog. What it does depends on the product's format:
- Roll wallpaper: Calculate rolls needed estimates the number of rolls for the shopper's walls.
- Panel wallpaper: Calculate panels needed estimates the number of panels (or sets) and recommends a panel height.
- Scenic mural: Find your mural size recommends the smallest size that covers the wall.
The calculator never adds anything to the cart. When the shopper applies the result, it sets the quantity (or selects the size) in the product form, and the shopper then clicks Add to cart.
Turn it on
- Set up the product's measurements with
walltropicmetafields. See Set up product metafields. - In the theme editor, open Theme settings > Wallpaper calculator and make sure Show calculators on product pages is on.
- Open your product template, and under Product information click Add block > Calculator. The default and mural templates already include it, just below the variant picker.
The block has no settings of its own. It shows a calculator for roll and panel products and the size finder for murals, and it's hidden when the product's measurements are missing. Its options are in Theme settings > Wallpaper calculator (see Wallpaper calculator settings).

When the button shows
The button shows only when all of these are true:
- Show calculators on product pages is on in Theme settings > Wallpaper calculator.
- The product's
walltropic.calculator_enabledmetafield isn't set to false. - The product's
walltropic.product_formatisroll,panelormural. - The selected variant (or the product) has the measurements the calculator needs:
- Roll: roll width and roll length, plus a pattern match of free, or straight or half-drop with a pattern repeat.
- Panel: a panel width, or a Default panel width in theme settings.
- Mural: at least one variant with both a mural width and a mural height.
When the measurements are missing, the theme editor shows "Calculator hidden: this product or variant is missing the walltropic measurements it needs." Shoppers see nothing.
What shoppers see
Rolls
- Shoppers choose Units (Inches, Feet, Centimeters or Meters) and enter the Width and Height of each wall. Add another wall adds more.
- Under Trim (optional), they can change Top trim and Bottom trim. The defaults come from your theme settings.
- The roll details (Roll width, Roll length, Pattern match and Pattern repeat) are shown read-only, "From the product's specifications."
- The Estimate lists the per-wall drops, the tallest wall (used for every drop), the cut length per drop, drops per roll, any waste buffer, and Estimated rolls needed.
- Use [number] rolls sets the quantity. The status line confirms "Quantity set to … Add to cart when you're ready."
How the estimate is worked out:
- Drops per wall = wall width ÷ roll width, rounded up. Openings such as doors and windows are not deducted.
- Cut length = tallest wall + top and bottom trim, plus one full pattern repeat for straight and half-drop matches.
- Drops per roll = roll length ÷ cut length, rounded down.
- Rolls = total drops (plus any waste buffer, as whole drops) ÷ drops per roll, rounded up.
If one drop is longer than a roll, the calculator explains that the wallpaper can't cover a wall that tall.
Panels
- Shoppers enter their walls the same way.
- The Estimate lists panels per wall (from the panel width), the Recommended panel height and Total panels. When one unit is a set of several panels, it also shows Sets to order.
- The recommended height is the smallest panel-height variant that covers the tallest wall plus your Height allowance. The calculator keeps the shopper's other choices (for example material) and tells them if it also changes the selected variant.
- Use [number] panels (or sets) selects that height and sets the quantity.
If no panel height is tall enough, the calculator says so and links to your help page. If the recommended variant doesn't say how many panels one unit contains (walltropic.panels_per_purchase_unit), the estimate still shows, but the quantity can't be set for the shopper.
Scenic murals
- Shoppers choose Units (Inches or Centimeters) and enter Wall width and Wall height.
- They can change the Width allowance and Height allowance (extra image on each side for trimming and uneven walls). The defaults come from your theme settings.
- Available sizes and fit lists every size with Recommended, Fits, but larger than needed or Too small, and how much bigger or smaller it is.
- Choose [size] selects the recommended size. The quantity stays at 1, because each size is one complete image.
If no size covers the wall, the dialog shows "No size fits? Contact us", linking to the Help link in theme settings (or your contact page).
Tips
- Every estimate is labeled as an estimate, with the note: "Supplier instructions and your installer's advice come first."
- Add the Calculator block close to the variant picker and buy buttons so shoppers see the result next to the quantity.
- To hide the calculator on one product (for example a non-standard roll), set its
walltropic.calculator_enabledmetafield to false. - The calculator's files load only on product pages where it's shown.