Automatically adding bundle details to your Shopify store
This article applies to Simple Bundles 1.0 and 2.0.
To show bundle contents on your Shopify product pages automatically, read the bundle details from Shopify metafields and display them with a Liquid code snippet. Simple Bundles saves each bundle variant's contents in the simple_bundles.bundled_variants variant metafield. Add the snippet with a Custom Liquid block in the theme editor, or in your theme code on vintage themes.
Get the bundle details code snippet
Copy the code snippet below. It lists the quantity, product title, and variant title of each item in the bundle. You can change it to add or remove fields.
You can also copy this code snippet from this GitHub Gist.
Note: The snippet shows the contents of the variant that's selected when the page loads. Depending on your theme, the list may not update when a customer picks a different variant until the page reloads. For infinite options bundles, it lists every product linked to any option value, not the customer's selection.
How do I add bundle details with a Custom Liquid block?
Use this method on Online Store 2.0 themes.
- In Shopify, go to Online Store > Themes and click Customize.
- Open your product template from the page selector at the top of the theme editor.
- In the product information section, click Add block and choose Custom Liquid. Section and block names vary by theme. If you can't find them, check your theme's documentation.
- Paste the code snippet into the block.
- Drag the block to where you want it, usually below the product description.
- Click Save.
How do I add bundle details in the theme code?
If your theme doesn't support Custom Liquid blocks (vintage themes), add the snippet to the theme code instead.
- In Shopify, go to Online Store > Themes. Next to your theme, open the ... menu and click Edit code.
- Open the file that renders your product details. On many vintage themes, it's product-template.liquid in the Sections folder or product.liquid in the Templates folder. File names vary by theme.
- Paste the code snippet where you want the list to appear, usually after the product description.
- Click Save.
To display other bundle details, see Access bundle details using Shopify metafields.
Related articles
Access bundle details using Shopify metafields