Conditional & Advanced Pricing: Charging Different Prices Based on Customer Input
<p>This guide is the hub for every "how do I charge more when…" question — surcharges past a threshold, different rates per option, tiered/volume pricing, and area-based rates. It shows which tool to use for each, the exact formula operators and functions the calculator supports, and the two mistakes that cause most "wrong price" tickets.</p><p>Everything here uses features you already have. If you'd rather not build it by hand, <a href="https://support.custompricecalculator.com/en/article/creating-a-custom-price-calculator-for-shopify-using-ai-ac8cd2dc/" target="\_blank" rel="noopener noreferrer">Calcy — Build with AI</a> can set most of this up from a plain-English description.</p><h2>The four ways to make price depend on input</h2><p>There isn't one "conditional logic" switch — there are four tools, each best for a different job. Pick the row that matches your rule:</p><ul><li><strong>A price that changes past a threshold</strong> (e.g. "add a fee when width > 60") → <strong>Number input ranges</strong></li><li><strong>A different rate per selected option</strong> (e.g. premium vs standard) → <strong>Dropdown / Radio / Image Selector</strong> with a value per option</li><li><strong>An optional add-on fee</strong> (e.g. installation, engraving) → <strong>Checkbox</strong></li><li><strong>A rate that depends on two inputs or a whole table</strong> (e.g. area → per-unit price, tiered quantity) → <strong>Data Lookup</strong></li></ul><p>You can also <strong>conditionally show or hide any element</strong> based on another input — see <a href="#conditional-display" target="\_blank" rel="noopener noreferrer">Conditional display</a> at the end.</p><h2>What the formula supports (reference)</h2><ul><li><strong>Operators:</strong> <code>+ - \* / ^</code></li><li><strong>Functions:</strong> <code>ceil()</code>, <code>floor()</code>, <code>round()</code>, <code>max()</code>, <code>min()</code></li><li><strong>Fallback for optional fields:</strong> <code>(Width || 0)</code> — treats an empty field as 0 so you never get <code>NaN</code></li><li><strong>Shopify base price:</strong> the reserved keyword <code>shopify\_price</code> (or <code>shopify\_product\_price</code>) pulls the selected variant's price into your formula</li><li><strong>Rounding money:</strong> <code>round(Width \* Height \* Rate, 2)</code> — or set <strong>Formula Output Decimals</strong> to 2 in calculator settings</li></ul><p>Field names in the formula must match the element's label <strong>exactly</strong>, including capitalization and spaces.</p><h2>Recipe 1 — A surcharge that only applies past a threshold</h2><p><em>"Charge $4.50/sq ft, and add a $15 cutting fee only when width is over 60 inches."</em></>

Use the range feature on a Number input. On the Width element, define ranges that return a value based on what the customer enters — for example, a range up to 60 returns 0, and a range above 60 returns 15. Reference that returned value in your formula as a variable:
round((Width \* Height / 144) \* 4.50 + CuttingFee, 2)- The Number input's ranges produce
CuttingFee(0 or 15) based on the entered width — no free-text guessing. /144converts square inches to square feet.- Tip: a Number input can return either the range value (
labelname) or the actual number the customer typed (labelname[actualvalue]) — use the actual value for the area math and the range value for the fee.
Recipe 2 — A different rate per selected option
"Premium fabric costs $4.00/sq ft, standard costs $2.50/sq ft."

Use a Dropdown (or Radio / Image Selector) and assign each option its own value — Standard = 2.50, Premium = 4.00. Mark it for use in the formula as Rate, then:
round((Width \* Height / 144) \* Rate, 2)Because the selected option is the number, there's nothing to maintain when a price changes — just edit the option value. Don't try to read a material name from a text field; assign the value to the option instead. (This is the fix for the recurring "can I price based on what they type" question — you price on the selected value, not free text.)
Recipe 3 — An optional add-on fee
"Add $100 for installation if the customer wants it."
Use a Checkbox. Set unchecked = 0, checked = 100, label it Installation, then add it to your formula:
shopify\_price + InstallationBase price shows by default; ticking the box adds the fee live. Works for engraving, gift wrap, rush handling — any yes/no upcharge.
Recipe 4 — Tiered, volume, or area-based pricing (Data Lookup)
"$5 each for 1–9, $4 for 10–49, $3 for 50+" — or — "price per sq ft drops as total area grows."
Use the Data Lookup element. It takes two inputs, matches them against a table you paste from Excel/Sheets, and returns the matched value into your formula. For a single-axis tier (quantity only), you can drive one lookup input from a formula (e.g. set it to 1) and the other to your quantity or Length \* Width. See the dedicated guides: Data Lookup and Area-based discounts through Data Lookup.
Data Lookup is the right tool whenever the rule is really a table — many tiers, or a rate that depends on two dimensions at once. It's cleaner and more maintainable than stacking many ranges.
The two mistakes behind most "wrong price" tickets
1. A field name in the formula doesn't match the element label. Width ≠ width ≠ Width (in). If your price shows $0 or Invalid formula, this is the first thing to check — the reference must match the label character-for-character.
2. Marking the wrong inputs for use in the formula, or leaving required fields optional. Only the inputs your formula actually references should feed it. Purely informational fields (a name to engrave, an uploaded file, a note) should not be in the price. And optional numeric inputs should use (Field || 0) so a blank never turns the whole price into NaN. Make truly required fields mandatory so they can't be left empty.
Conditional display (show/hide elements)
Separate from pricing, you can conditionally show or hide any element based on another input — for example, only reveal a "Frame color" dropdown when "Add frame" is checked. This keeps complex calculators clean. (Note: turning on formula-driven input for a Data Lookup element disables conditional display for that element.)

Still stuck?
If your rule is a lookup table, per-variant logic, or something you can't express with the tools above, start a live chat in the app and describe it in plain English ("I want X to happen when Y"). Support will map it to the right element and formula — or tell you if it needs a custom setup.
Add Apippa Custom Price Calculator to your Shopify store — start free: https://apps.shopify.com/custom-price-calculator
Updated on: 02/08/2026
Thank you!