How to price add-ons per foot or metre on Shopify
Short answer: price the product by length, and give each add-on a price per foot (or per metre). The customer types the length they need, and every add-on that runs the full length is charged its rate × that length. Conditions such as "over 20 ft, add a centre support" or "30 ft and up, 5% off" are pricing rules. An option can also show only when another choice makes it relevant. A Shopify Function charges that exact price at checkout.
Why fixed add-on prices don't scale
Most option setups give an add-on one fixed price. That works for a gift box, not for a cover, a coating or a liner that runs the whole length of the product: a cover on a 6 ft trough uses a fraction of the material a cover on a 36 ft trough does. To get it right with fixed prices, you end up with one option set per length, or a variant for every length and add-on combination. Whole-foot lengths from 4 to 40 ft, three materials and two add-ons already make 37 × 3 × 4 = 444 combinations to keep priced, and every price change means editing them all.
In a spreadsheet it's one line: rate × length. Your product page can work the same way.
How the price builds up
price = length × material rate + (each per-foot add-on's rate × length) + flat add-ons
This is how Trimsize adds it up, not something you type in: the product's own formula stays length * rate, and each add-on carries its rate. Any minimum charge and percentage add-ons come next. Rules then run in order on the running total: a fee adds to it, and a discount takes its percentage off everything above it. The whole sequence is on How prices work.
Worked examples
A livestock feed trough sold by the foot, 4 to 40 ft: galvanised steel at $38/ft, stainless steel at $64/ft, poly at $26/ft. A rain cover is $9/ft. On galvanised troughs only, a coating can be added: powder coat at $6/ft or epoxy at $11/ft. A leg kit adds one leg every 8 ft plus one, at $25 each. Troughs over 20 ft get a $120 centre support, and troughs of 30 ft or more are 5% off.
| Trough | Working | Price |
|---|---|---|
| 10 ft galvanised | 10 × $38 | $380.00 |
| 10 ft galvanised, rain cover | $380 + 10 × $9 | $470.00 |
| 16 ft galvanised, rain cover, epoxy | $608 + 16 × $9 + 16 × $11 | $928.00 |
| 24 ft galvanised, rain cover, powder coat, leg kit | $912 + 24 × $9 + 24 × $6 + $120 support + 4 legs × $25 | $1,492.00 |
| 32 ft stainless, rain cover, leg kit | ($2,048 + 32 × $9 + $120 support + 5 legs × $25) − 5% | $2,451.95 |
| 40 ft poly, leg kit | ($1,040 + $120 support + 6 legs × $25) − 5% | $1,244.50 |
Each price was worked out by Trimsize and checked by hand. The 32 ft stainless trough costs $2,451.95 on the product page and in the cart.
IF logic, three ways
"IF" means different things in a quote spreadsheet, and Trimsize has a place for each.
Show an option only when it applies
Give an add-on a Show only when condition. It can test the material, the length or an add-on above it, and you can combine up to five tests with all or any. "Coating: only when the material is galvanised steel" hides the coating for stainless and poly, and a hidden add-on is never charged, even if it was chosen before the material changed. When an option depends only on the material, there's a simpler route: untick Applies to all materials and tick the ones it's for. See Add-ons.
Add a fee or a discount when a condition holds
A pricing rule is a condition and an action: Length greater than 20 → add a flat fee of $120, or Length greater or equal 30 → apply a 5% discount. Conditions can test the length, the quantity or any add-on, and the action can add a fee, multiply the price or take a percentage off. See Rules.
Make an amount a formula
A rule's amount can be a formula of the length and the add-ons. The leg kit above is one rule, Leg kit is selected → add (ceil(length / 8) + 1) * 25, where ceil rounds up: a 24 ft trough gets 4 legs, a 32 ft trough 5. Formulas also support if/else (condition ? a : b), comparisons, and/or, and min, max, round, ceil and floor. So a tiered rate, $12/ft from 40 ft and $14/ft below, is length >= 40 ? length * 12 : length * 14 in the product's price formula. See Pricing editor.
A different rate per choice
A dropdown add-on can give each choice its own price type and amount. "None" costs nothing, "Powder coat" is $6/ft, "Epoxy" is $11/ft, and the product page shows the rate next to each choice, so the customer sees why the price moves.
Feet, metres or inches
The length can be in feet, inches, metres, centimetres or millimetres, and add-on rates can be per foot, inch, metre, centimetre or millimetre. You can also let customers type the length in another unit: a trough priced in feet can take metres, and Trimsize converts before pricing. Limits and rules stay in the product's unit. Set the shortest and longest length you make as the product's size limits, with your own message. See Size limits.
Set it up with Trimsize
- Install Trimsize, open your product and click Create configuration. Set Priced by to Length and the unit to feet.
- Add your materials with their rate per foot. See Materials.
- Add the add-ons. A Yes / no add-on with the price Per length ($) is charged along the length; a dropdown can give each choice its own per-foot rate. Use Show only when for the options that depend on another choice.
- Add the rules under Rules & limits, and set the length limits there. The free plan has one rule per product; Pro has no limit, and the trough above uses three.
- Check a few lengths in the live preview against your spreadsheet, then add the Trimsize block to the product page and place a test order.
Sell several products the same way by saving the setup as a template: each product follows it, and a change to the template updates them all.
Common mistakes
- A flat price for a full-length add-on. A cover priced for an average length loses money on every long order and overprices every short one.
- Discounting before the fees. Rules apply in order. Put the length discount last if the 5% should come off the supports and legs too, as in the examples above.
- Leaving the default length limits. The default range runs far past what you make, so a customer could order a trough hundreds of feet long. Set the shortest and longest lengths and the message they see.
- Options that don't apply still showing. A coating offered on stainless invites questions and refunds. Show it only for the materials that take it.
Questions
Can an add-on's price depend on the length the customer chooses?
Yes. Give the add-on the price type Per length and a rate per foot or metre, and it's charged at that rate times the length the customer enters, on the product page and at checkout.
Does Trimsize support IF statements?
Yes, in three places: pricing rules (a condition, then a fee, multiplier or discount), conditions on when an add-on shows, and formulas that can choose between two amounts, for example one rate under 40 ft and another from 40 ft, round up, or take the smaller or larger of two values.
What appears in the cart and on the order?
One line with the product, the length, the material and each add-on chosen, at the price the product page showed. The order carries the same line, so you know exactly what to make.
Do I need a variant for every length?
No. One variant is enough: Trimsize prices any length between your limits, and a Shopify Function charges that price at checkout.