A build-your-own-bundle section for Shopify: shoppers choose a set number of products from one collection, watch them fill a bundle tray with a live total, and add the whole bundle to the cart in one step. Use it on the home page, a landing page or a gift page to sell sets without a bundle app. Copy section.liquid into your theme's sections folder and add it from the theme editor as "WDS Bundle builder".
How it works
Each product card has an Add to bundle toggle button and, for products with several variants, a variant select. Once the bundle is full, the other buttons read Bundle full until a product is removed. Sold-out products, and products sold only with a subscription, show a disabled Sold out button.
The tray shows the chosen products in numbered slots with a progress bar, remove buttons and the total in your store's money format. Add bundle to cart sends all items in one Cart API request (/cart/add.js), respecting each variant's minimum quantity. If Shopify refuses it, for example because an item just sold out, its message appears in the tray. On success the section shows a message with a cart link, or goes to the cart page.
On screens 990 px and wider, the tray sits beside the grid and stays in view while scrolling. On smaller screens it sticks to the bottom of the section with compact thumbnails.
Customization
- Collection to choose from, Products per bundle (2 to 5), Products to show and Columns on desktop.
- Discount note: optional text under the total.
- After adding the bundle: show a message with a cart link, or go to the cart page.
- Labels: every button, progress, hint, success and error text.
[count],[size],[n]and[title]are replaced automatically. - Background, Text, Accent (buttons) and Button text colors, plus Side, Top and Bottom padding.
Accessibility
Add buttons use aria-pressed and are tied to the product name. Remove buttons have names like "Remove Stoneware mug from bundle", and focus moves to the next one after use. The hint is announced politely, errors use role="alert", all controls show a focus outline, and transitions stop for people who prefer reduced motion.
Usage notes
This section requires an Online Store 2.0 theme and takes its fonts from it. It does not change prices: the note only describes a discount you set up yourself, such as an automatic discount in Shopify admin. Without one, shoppers pay the normal price of each item.
Many themes do not refresh their cart drawer or cart count after a Cart API request. The section dispatches a wds:cart:updated event you can hook into, or choose Go to the cart page. Each product can be added once per bundle.
The preview uses sample products from an invented store with photos from Unsplash; replace them with your own products. In the preview the cart request is simulated and two products start in the bundle.