Bundle Templates
Bundle templates in Glood.AI control how product bundles are displayed in your Shopify store. Similar to section templates, they use Liquid templating with JavaScript hooks and CSS, rendered via Preact and LiquidJS.What are Bundle Templates?
Bundle templates are modular components that determine how your product bundles appear to customers. They are:- Liquid-Powered: Use Liquid templating for dynamic content rendering, consistent with Shopify’s template language.
- JavaScript-Enhanced: Templates include JS hooks that run at key lifecycle points — configuration load, render, variant change, and cart operations.
- Preact-Rendered: The bundle storefront uses Preact for efficient UI rendering and state management.
-
Multi-Component Structure: Each template consists of:
- Liquid template for markup
- JavaScript hooks for interactivity
- CSS (with Liquid variables) for styling
- Settings JSON for configuration
- Translation strings for internationalization
Layout Types
Bundle templates support two layout types:| Layout | Value | Description |
|---|---|---|
| Bundle | bundle | Full bundle display on the product page, showing all bundled products together |
| Bundle Component | bundle_component | Component selector view, allowing customers to customize bundle selections |
Template Components Overview
Liquid Template
The main markup defining bundle structure — product cards, images, titles, prices, variant selectors, and add-to-cart elements. See Default Template.JavaScript Hooks
Five lifecycle hooks for customizing bundle behavior:OnConfigLoad— modify bundle data at load timeOnBundleRender— transform product data before renderingOnVariantChange— respond to variant selectionsOnAddToCart— intercept add-to-cart actionsOnAddedToCart— handle post-cart operations
CSS Template
Liquid-powered CSS that uses template settings for dynamic theming — colors, fonts, sizes, and spacing are all configurable. See Default CSS.Settings
JSON configuration controlling display mode, product card styling, pricing, colors, spacing, and mobile behavior. See Settings.Translations
Localized text strings for all user-facing bundle UI elements. See Translations.Extension Points
Customize bundle behavior through JavaScript hooks:Libraries
The bundle template system uses the following core libraries:- Preact (
^10.22.1) — Lightweight UI library for rendering bundle components - LiquidJS (
^10.19.0) — Template engine for rendering Liquid markup on the client side
Next Steps
- View the Default Template markup
- Explore Hooks for lifecycle customization
- Check Settings for configuration options
- Review Translations for localization