Skip to content

Refill calculator

Set up the Refill sum, which compares buying new bottles with one bottle and refills over a time the shopper picks.

Updated

The Refill sum compares two ways to buy the same product over 6 to 36 months: new bottles each time, or one bottle and refills. It uses your own prices and how long a bottle lasts. Products without a refill are left out of the section.

Before you start

You need a refill product for each bottle you want to compare, and a number of weeks one bottle lasts. Both can come from the product, so you set them once:

  • custom.refill: product reference, pointing to the refill product
  • custom.lasts_weeks: integer, how many weeks one bottle lasts

Create them under Settings > Custom data > Products. See Product data. You can also set the refill and the weeks on the block.

Add the section

  1. In the theme editor, open the page and select Add section, then choose Refill sum.
  2. Set Heading, Text and optionally Image.
  3. Add a Bottle and refill block, up to 4 in all.
  4. On each block, pick the Product. Pick the Refill if the product has no custom.refill.
  5. Edit the labels and the Result sentence.

Mosto's home page template already includes this section.

Section settings

LabelWhat it does
HeadingDefault "Keep the bottle".
TextA short paragraph under the heading.
ImageShown beside the sum.
Range labelDefault "How long".
Length of timeDefault "[months] months". [months] is replaced by the number on the slider.
New bottles labelDefault "New bottles".
Refills labelDefault "One bottle and refills".
Result sentenceDefault "[fills] fills. You keep [saved] and [bottles] bottles." [fills], [saved] and [bottles] are replaced by the sum.
Editor message when nothing can be shownDefault "Add a product with a refill to show the sum." Shown in the editor only.
Label above the sectionA short line such as a batch or chapter number. Leave blank to hide it.
Color schemeDefault scheme-amber.

Bottle and refill block settings

LabelWhat it does
ProductThe bottle.
RefillLeave empty to use the product's refill metafield.
Button labelThe name on the block's button. Defaults to the product title.
Weeks a bottle lastsFrom 2 to 30, default 8. Used only when the product has no custom.lasts_weeks metafield.

How the sum works

The slider runs from 6 to 36 months in steps of 6 and starts at 12. The number of fills is the time in weeks divided by the weeks a bottle lasts, rounded up, and never below 1. The theme counts 4.345 weeks to a month.

  • New bottles is the number of fills times the bottle price.
  • One bottle and refills is one bottle price plus a refill price for every fill after the first.
  • The saving in the result sentence is the difference, and [bottles] is the number of fills minus one.

Prices come from each product's first available variant. When a section has more than one block, each shows as a button and the shopper switches between them.

When the section is hidden

A block counts only when it has a product and a refill. With no usable block, the section does not appear on the live store. In the editor it shows the editor message instead.

Still stuck? Get theme support