Dose calculator
Works out a daily amount from the customer’s body weight. Customers switch between kg and lb and move a slider. The calculator shows up to three results: the daily amount, how many servings that is, and how many days one container lasts.
Where it works
Section titled “Where it works”Text with panel, Custom section.
Settings
Section titled “Settings”| Setting | What it does | Starts as |
|---|---|---|
| Product | Names the calculator and adds a link with the price. On a product page, leave empty to use that product. | Empty |
| Amount per kg of body weight | A number, such as 0.07. | Empty |
| Unit | The unit of every number, such as g or mg | “g” |
| Serving size | A number in the same unit. Leave empty to hide the servings row. | Empty |
| Serving name | What a serving is called, such as “Scoops” | “Servings” |
| Container size | A number in the same unit. Leave empty to hide the row that says how long one container lasts. | Empty |
| Use each variant’s weight as the container size | The days count follows the size the customer picks. Works when the unit is g, kg, mg, oz or lb. A variant with no weight uses the container size above. | Off |
| First weight unit | Kilograms or Pounds, the unit the calculator starts in | Kilograms |
| Note | A line under the results | A line that says what to write |
In the theme editor the settings are in two groups, Numbers and For the customer.
Type each number, or connect a product field that holds one: a whole number, a decimal, a weight or a volume. A field’s own unit is left out, so keep all three numbers in the unit named in Unit.
Set up the calculator for one product
Section titled “Set up the calculator for one product”- Create the product fields for the amount per kg and the serving size. See Connect product fields.
- Fill them in on the product in your Shopify admin.
- For each variant, set its weight to the net weight of its container, such as 300 g.
- In the theme editor, open the product template and select the Dose calculator block.
- Connect Amount per kg of body weight and Serving size to the fields.
- Turn on Use each variant’s weight as the container size.
- Click Save.
Good to know
Section titled “Good to know”- The numbers are yours. There are no default numbers, and the calculator shows nothing until Amount per kg of body weight is set.
- On a new install’s product page, the section that holds the calculator has Hide when panel is empty turned on, so products without the numbers do not show it.