Skip to content

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.

Text with panel, Custom section.

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.

  1. Create the product fields for the amount per kg and the serving size. See Connect product fields.
  2. Fill them in on the product in your Shopify admin.
  3. For each variant, set its weight to the net weight of its container, such as 300 g.
  4. In the theme editor, open the product template and select the Dose calculator block.
  5. Connect Amount per kg of body weight and Serving size to the fields.
  6. Turn on Use each variant’s weight as the container size.
  7. Click Save.
  • 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.