Hello i need a bit help to loop the products that are in the bundle product.
I know i can loop them from the cart but i can’t find any ways to loop them direct on the product page.
So the customer can see a list of what products that are in the bundle product.
We are using Shopify Bundles.
Hello @JonasNiko ,
You can use the icart cart drawer cart upsell app to suggest additional products or bundles, though it may not directly help display bundle contents on the product page.
Other than that, You will need to add Liquid code to loop through the products included in the bundle. Here’s an example snippet:
{% if product.tags contains 'bundle' %}
### Products in this Bundle:
{% for variant in product.variants %}
{% assign bundle_product = all_products[variant.sku] %}
{% if bundle_product %}
- {{ bundle_product.title }}
- {{ bundle_product.price | money }}
{% endif %}
{% endfor %}
{% endif %}
Adjust the code based on how you store and reference your bundle products. This example assumes you’re tagging bundle products and using SKU to reference individual products.
@rutvik_shop careful of using chatgtp etc to try and infill an answer with slop in order to push an app.
That generated liquid code hits the all_products object that can only be used 20 times per page, and it’s trying to use it with a sku and not a handle.
And labeling a variable "bundle_product " doesn’t actually address the question of identifying actual bundle components.