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 productcustom.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
- In the theme editor, open the page and select Add section, then choose Refill sum.
- Set Heading, Text and optionally Image.
- Add a Bottle and refill block, up to 4 in all.
- On each block, pick the Product. Pick the Refill if the product has no
custom.refill. - Edit the labels and the Result sentence.
Mosto's home page template already includes this section.
Section settings
| Label | What it does |
|---|---|
| Heading | Default "Keep the bottle". |
| Text | A short paragraph under the heading. |
| Image | Shown beside the sum. |
| Range label | Default "How long". |
| Length of time | Default "[months] months". [months] is replaced by the number on the slider. |
| New bottles label | Default "New bottles". |
| Refills label | Default "One bottle and refills". |
| Result sentence | Default "[fills] fills. You keep [saved] and [bottles] bottles." [fills], [saved] and [bottles] are replaced by the sum. |
| Editor message when nothing can be shown | Default "Add a product with a refill to show the sum." Shown in the editor only. |
| Label above the section | A short line such as a batch or chapter number. Leave blank to hide it. |
| Color scheme | Default scheme-amber. |
Bottle and refill block settings
| Label | What it does |
|---|---|
| Product | The bottle. |
| Refill | Leave empty to use the product's refill metafield. |
| Button label | The name on the block's button. Defaults to the product title. |
| Weeks a bottle lasts | From 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.
Related
Still stuck? Get theme support