Access bundle details using Shopify metafields

This article applies to Simple Bundles 1.0 and 2.0. Bundles in both versions store their contents in the same variant metafield. 2.0 bundles include one extra field, noted below. To add bundle details to orders instead, refer to Enabling bundle details in Shopify order metafields.

Simple Bundles stores each bundle's contents in a Shopify metafield on the bundle variant, so you or a developer can read bundle details through Shopify's Admin API or Liquid. This article shows where the metafield lives and what it contains.

Where is the bundle metafield stored?

Each time you save a bundle, Simple Bundles adds or updates a metafield on the bundle variant in Shopify:

  • Namespace: simple_bundles
  • Key: bundled_variants
  • Type: JSON

If you delete the bundle in Simple Bundles, the app removes the metafield.

How do I view the bundle metafield in Shopify?

  1. In Simple Bundles, open the bundle and click View variant in Shopify.
View variant in Shopify button on the Simple Bundles bundle page
View variant in Shopify
  1. On the variant page, scroll to the Metafields section and look for Simple Bundles - Bundled Variants. If you don't see it, click Show all.
  2. If the metafield isn't listed, your store doesn't have a definition for it yet. In your Shopify admin, go to Settings > Metafields and metaobjects > Variants and click View unstructured metafields.
  3. Check the bundle metafield value.
Bundle metafield details shown on the Shopify variant
Bundle metafield value

What fields does the bundle metafield include?

The metafield value is a JSON array with one object per product in the bundle. If you're using an external service, parse the JSON string into an object your program can read. Each object includes these fields:

{
  "variant_title": "Default Title",
  "variant_id": 31719040385067,
  "price": 64.0,
  "compare_at_price": null,
  "sku": "BOD350",
  "inventory_management": "shopify",
  "inventory_policy": "deny",
  "inventory_item_id": 33271437164587,
  "handle": "biona-organic-date-syrup-350g",
  "vendor": "biona",
  "product_title": "Biona Organic Date Syrup (350g)",
  "product_id": 4443481604139,
  "quantity_in_bundle": 1,
  "type": "Single-price bundle"
}

Infinite options bundles also include a variant_options  field in each object. Simple Bundles 2.0 bundles also include a bundle_discount_percentage  field.

To show these details on your storefront, see Automatically adding bundle details to your Shopify store.

Automatically adding bundle details to your Shopify store

Enabling bundle details in Shopify order metafields

How to bulk export bundle data

Still need help? Contact Us Contact Us