Add MetaFields to Bundle Products
If you would like to add Bundle composition Information to your product page, you need to enable this in Settings under the Bundle section.
and select the option Add bundle Composition to Product Variants as MetaFields.
With this App will add bundle composition information when you save or update the bundle in the app. App will save this info under
Namespace : profit_bundles
Key: bundle_composition
the type of this metafield will be json.
To test out the existing metafields, follow the steps below:
- Open the bundle for which you want to test metafields by clicking on it in the bundle list.
- Click on "View Product in Shopify", app will take you to the product variant detail page in admin section. Copy and paste the url in a new tab and add '/metafields.json' to it.
- You should be able to view the bundle metafield details:
The Metafield Contain Following bundle information.
[{"id":"gid://shopify/ProductVariant/47181247119655","title":"Arabica Coffee - 60% Vegan Dark Chocolate - Stevia Sweetened - 100G Bar","composition":1,"price":"1598.00"},{"id":"gid://shopify/ProductVariant/47181247152423","title":"Pecan Nut - 60% Vegan Dark Chocolate - Stevia Sweetened - 100 G Bar","composition":1,"price":"1598.00"},{"id":"gid://shopify/ProductVariant/47181247021351","title":"Zesty Orange - 60% Vegan Dark Chocolate - Stevia Sweetened - 100G Bar","composition":1,"price":"225.00"}]
To access this json value in your product liquid template, shopify recommends following way.