Product bundles are one of the most effective ways to increase average order value (AOV) in e-commerce. Many Shopify merchants want to sell combinations of products together—such as starter kits, mix-and-match bundles, or discounted product sets. While Shopify apps can provide basic bundling functionality, developers often build custom bundles for greater flexibility, better performance, and deeper control over the shopping experience.
In this guide, we’ll explore how developers can create custom product bundles using Shopify Liquid and the Cart Transform API, allowing merchants to build scalable bundle experiences without relying heavily on third-party apps.
Why Custom Product Bundles Matter
Bundles help merchants achieve several business goals:
• Increase average order value
• Promote complementary products
• Improve customer experience
• Reduce inventory stagnation
For example, a skincare brand may want to sell a “Daily Routine Kit” that includes a cleanser, toner, and moisturizer. Instead of creating a separate bundle product, developers can allow customers to build the bundle dynamically using storefront logic.
This level of flexibility is often implemented by hire shopify developers who can design custom bundle flows directly within the Shopify theme.
Step 1: Creating the Bundle Interface Using Liquid
The first step is building the bundle selection interface on the product page using Shopify Liquid.
Liquid allows you to dynamically display products and allows users to select bundle components.
Example:
<div class="bundle-products">
<h3>Create Your Bundle</h3>
{% for product in collections.bundle-products.products %}
<div class="bundle-item">
<h4>{{ product.title }}</h4>
<img src="{{ product.featured_image | img_url: 'medium' }}">
<select class="bundle-variant" data-product="{{ product.id }}">
{% for variant in product.variants %}
<option value="{{ variant.id }}">
{{ variant.title }} - {{ variant.price | money }}
</option>
{% endfor %}
</select>
</div>
{% endfor %}
<button id="add-bundle">Add Bundle to Cart</button>
</div>
This code displays a group of products that can be selected as part of a bundle. Each product allows customers to choose a variant before adding the bundle to the cart.
Step 2: Adding Bundle Items to the Cart
Next, we use JavaScript to collect selected products and send them to Shopify's cart.
Example JavaScript:
document.getElementById("add-bundle").addEventListener("click", function() {
const variants = document.querySelectorAll(".bundle-variant");
let items = [];
variants.forEach(select => {
items.push({
id: select.value,
quantity: 1,
properties: { bundle: "custom_bundle_01" }
});
});
fetch("/cart/add.js", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ items: items })
})
.then(response => response.json())
.then(data => console.log(data));
});
Here, we add multiple products to the cart at once while tagging them with a bundle identifier. This helps the cart understand that the items belong to a bundle.
Step 3: Using the Cart Transform API
Once the products are added, the Cart Transform API allows developers to modify how these items appear in the cart.
The API can:
• Merge multiple items into a single bundle display
• Adjust bundle pricing
• Apply discounts
• Display bundle metadata
Example (conceptual structure):
export default function transformCart(cart) {
return cart.lines.map(line => {
if (line.attributes.bundle === "custom_bundle_01") {
return {
...line,
title: "Starter Bundle",
price_adjustment: {
type: "percentage",
value: 10
}
};
}
return line;
});
}
This transformation allows Shopify to treat several products as one logical bundle while still tracking individual inventory items.
Businesses often work with shopify development partners when implementing advanced cart logic like this, since it requires careful coordination between frontend UI and backend cart behavior.
Step 4: Enhancing the Bundle Experience
Once the bundle system is working, developers can extend it with additional features:
1. Dynamic Bundle Pricing
Automatically apply discounts when specific product combinations are selected.
2. Inventory Synchronization
Ensure bundle components reflect accurate stock levels.
3. Smart Recommendations
Suggest bundles based on user behavior or purchase history.
4. Real-Time Bundle Preview
Update the total bundle price dynamically before adding it to the cart.
These enhancements improve user experience and drive higher conversions.
Benefits of Using Liquid + Cart Transform API
Building custom bundles using Shopify’s native tools provides several advantages:
1. Better Performance
Avoid heavy third-party apps that add extra scripts.
2. Full Customization
Develop bundle logic that perfectly matches business requirements.
3. Accurate Inventory Tracking
Each product in the bundle remains individually tracked.
4. Improved UX
Create seamless bundle-building interfaces directly within the storefront.
Companies that specialize in Shopify development often implement these custom solutions through a shopify expert agency that understands both the platform’s architecture and advanced e-commerce requirements.
Final Thoughts
Custom product bundles can significantly improve both conversion rates and average order value for Shopify stores. While Shopify apps offer quick solutions, building bundles using Liquid and the Cart Transform API provides unmatched flexibility and performance.
For merchants aiming to create tailored shopping experiences, investing in custom bundle functionality allows them to deliver unique offers, better product combinations, and scalable solutions that grow with their business.
As Shopify continues evolving its developer ecosystem, advanced features like the Cart Transform API will play a major role in enabling more dynamic, powerful storefront experiences.
Top comments (0)