> ## Documentation Index
> Fetch the complete documentation index at: https://partner-docs.foxsell.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross Sell Bundles

> Metafields and Metaobject Structure for Cross Sell Bundles

<Tabs>
  <Tab title="Structure">
    <ResponseField name="cross_sell_bundle_config" type="metaobject">
      Cross Sell Bundle Settings Metaobject

      <Expandable title="fields" defaultOpen>
        <ResponseField name="active" type="boolean" required>
          If Bundle is set `active` on the app
        </ResponseField>

        <ResponseField name="bundled_products" type="list of product references" required>
          List of Product References that are part of the Cross Sell Bundle
        </ResponseField>

        <ResponseField name="product_properties" type="{key: value}" required>
          <Note>Object is a Key Value Pair `{key: value}`</Note>

          <Expandable title="fields">
            <ResponseField name="key" type="string">
              Shopify Product GID
            </ResponseField>

            <ResponseField name="value" type="json">
              Product Properties

              <Expandable title="fields">
                <ResponseField name="bundle_id" type="string">
                  ID of the bundle in the app
                </ResponseField>

                <ResponseField name="quantity" type="number">
                  Quantity of the Product in the bundle
                </ResponseField>

                <ResponseField name="variants" type="list">
                  List of Shopify Variant GIDs for selected variants
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="discount" type="json" required>
          Discount Settings configured in the app

          <Expandable title="fields">
            <ResponseField name="strategy" type="string">
              Value will always be `percentage`
            </ResponseField>

            <ResponseField name="value" type="number">
              Value of the discount
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="widget_settings" type="json" required>
          Widget Settings configured in the app.

          <Expandable title="fields">
            <ResponseField name="title" type="string">
              Heading of the Widget
            </ResponseField>

            <ResponseField name="show_discount_percentage" type="boolean">
              Should the Discout Percentage be Shown
            </ResponseField>

            <ResponseField name="show_compare_at_price" type="boolean">
              Should Compare At Price be Shown
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="Liquid Section">
    <Tip>
      Add this snippet as a section in your theme to see the values of the metafield
    </Tip>

    ```liquid theme={null}
    {% liquid
      assign app_namespace = 'app--67872686081'

      assign cross_sell_bundle_config = product.metafields[app_namespace].cross_sell_products.value

      assign active = cross_sell_bundle_config.active
    %}
    <p>
      <strong>Active: </strong>
      {{ active }}
    </p>
    <p><strong>Widget Settings:</strong></p>
    <p>{{ cross_sell_bundle_config.widget_settings.value | json }}</p>

    <p><strong>Discount:</strong></p>
    <p>{{ cross_sell_bundle_config.discount.value | json }}</p>

    <p><strong>Products:</strong></p>
    {% for bundled_product in cross_sell_bundle_config.bundled_products.value %}
      {% liquid
        assign product_gid = product.id | prepend: 'gid://shopify/Product/'
        assign bundled_product_properties = cross_sell_bundle_config.product_properties.value[product_gid]
      %}
      <p><strong>Product Title: </strong>{{ bundled_product.title }}</p>
      <p><strong>Product Properties: </strong></p>
      <p><strong>Bundle ID: </strong>{{ bundled_product_properties.bundle_id }}</p>
      <p><strong>Quantity: </strong>{{ bundled_product_properties.quantity }}</p>
      <p><strong>Available Variant Ids: </strong>{{ bundled_product_properties.variant_ids }}</p>
    {% endfor %}

    {% schema %}
    {
      "name": "FoxSell CSW Snippet",
      "tag": "section",
      "blocks": [],
      "settings": [

      ],
      "presets": [
        {
          "name": "FoxSell CSW Snippet"
        }
      ]
    }
    {% endschema %}
    ```
  </Tab>

  <Tab title="Javascript">
    <Warning>
      This is Work in Progress. Stay Tuned!
    </Warning>
  </Tab>
</Tabs>
