Add Captain Brew's brewing calculators to your Shopify store with a Custom Liquid section. No app to install and no theme code to edit. Your customers work out IBU, priming sugar or yeast pitch rates on your product pages, not on someone else's site.
The widgets need a Captain Brew shop plan: 1 month free, then $25/month. No setup fee, no commitment.
You need three things:
yourshop.com. If you have not connected a custom domain, use your yourshop.myshopify.com address. Your first month is free.This is what a snippet looks like. The one you copy from the portal has your own token instead of YOUR_CLIENT_TOKEN.
<iframe id="ibu_calculator"
src="https://www.captainbrew.com/iframes/ibucalculator.php?client=YOUR_CLIENT_TOKEN"></iframe>
<style>
#ibu_calculator{
width:100%;
height:1280px;
border:0px;
}
@media only screen and (max-width : 991px) {
#ibu_calculator{height:1400px;}
}
@media only screen and (max-width : 767px) {
#ibu_calculator{height:3600px;}
}
</style>
The <iframe> loads the calculator. The <style> block sets its height, with a taller height on narrow screens where the calculator's fields stack. Paste both parts together.
This puts a calculator on any page that uses a template, such as your home page.
The preview in the theme editor may show Forbidden instead of the calculator. The widget only loads on the domain registered to your Captain Brew account, and the editor preview can run on a different address. Open the page on your live store to check it.
The Custom Liquid section is in the Template area. If you add it to the header or footer instead, it shows on every page of your store, which is rarely what you want for a calculator.
Shopify pages use the default page template, which only shows the page's text. To put calculators on a page, make a page template for them first, then assign it to a new page.
calculators, choose Default page in Based on, and click Create template.calculators.A Shopify template can have up to 25 sections. Each calculator has its own iframe ID, so several different calculators can share a page. Don't add the same calculator twice on one page.
Calculators sell best next to the product they are about: the IBU calculator on hops, the priming sugar calculator on bottling sugar, the pitch rate calculator on yeast. Use a separate product template so the calculator only shows on the products that need it.
hops and base it on Default product.hops in the Theme template drop-down and click Save.To switch many products at once, select them in Products, click Bulk edit, add the Template column from the Columns menu and set it to hops.
A Custom Liquid block inside Product information sits in the product column, which is narrow on desktop. Larger calculators such as the IBU calculator and water chemistry are easier to use in a full-width Custom Liquid section below the product.
An iframe does not grow with its content, so the snippet sets a fixed height and a taller height for each smaller screen width. These are the starting heights for some common calculators:
| Widget | iframe ID | Desktop | Phone |
|---|---|---|---|
| IBU Calculator | ibu_calculator |
1280px | 3600px |
| ABV Calculator | abv_calculator |
340px | 550px |
| Priming Sugar Calculator | priming_calculator |
840px | 1350px |
| Keg Carbonation Calculator | keg_calculator |
340px | 600px |
| Pitching Rate Calculator | yeast_calculator |
1350px | 4500px |
| Water Chemistry Calculator | waterchemistry_calculator |
3700px | 8240px |
| Complete Recipe Builder | recipe_calculator |
1400px | 2000px |
If the bottom of a calculator is cut off, or there is a scroll bar inside it, raise the height in the matching @media rule of your snippet. If there is a large empty gap below it, lower the height. Check on a phone after saving: your theme's padding changes how much room the calculator gets.
page-width container:<div class="page-width">
<iframe id="ibu_calculator"
src="https://www.captainbrew.com/iframes/ibucalculator.php?client=YOUR_CLIENT_TOKEN"></iframe>
<style>
#ibu_calculator{
width:100%;
height:1280px;
border:0px;
}
@media only screen and (max-width : 991px) {
#ibu_calculator{height:1400px;}
}
@media only screen and (max-width : 767px) {
#ibu_calculator{height:3600px;}
}
</style>
</div>
Other themes use different class names for this container. If yours doesn't line up, check its documentation or leave the wrapper out.
Widgets are styled to your brand colours from your Business Portal settings, so they don't pick up your theme's colours automatically.
The recipe builder goes on a page the same way: make a page template, add a Custom Liquid section and paste the recipe builder snippet. It shows the malts, hops and yeasts from the catalog you uploaded to the Business Portal.
With add-to-cart turned on, the builder sends the recipe's ingredient list to your page as a browser message when the customer clicks Add to Cart. The Business Portal has a listener script and the exact data format. You can paste the script into the same Custom Liquid section, below the iframe. Your developer then matches each item to a Shopify product variant and adds it with Shopify's cart (for example the Ajax Cart API). The calculators and charts need none of this.
No. Each Captain Brew widget is an iframe. You paste it into a Custom Liquid section or block in the Shopify theme editor. There is nothing to install from the Shopify App Store and no theme code to edit.
No. The widgets are part of the Captain Brew Homebrew Shop Widgets plan. The first month is free, then it is $25 per month for every widget, with no setup fee. The widgets only load on the shop domain registered to your account.
It works with any theme that has a Custom Liquid section, which includes Dawn and Shopify's other free themes. If your theme has no Custom Liquid option, you can paste the code into a page's HTML view instead, or ask your theme developer.
Yes. Create a product template, add a Custom Liquid block or section with the calculator, and assign that template to the products you want, for example the IBU calculator on hop products.
Yes. The embed code sets a different iframe height for phones, tablets and desktops, so the calculator is not cut off on small screens.
The widget only loads on the domain you registered in the Business Portal. Check that the page is on that domain. The theme editor preview may run on a different address, so check the live page too. If it still fails, email [email protected].
Stuck on a step? Email [email protected].