Pre-fill the bundle widget using query parameters

This guide covers how you can pre-fill the bundle widget by using query parameters.

📘

Platforms:

  • Recharge Checkout on Shopify
  • Shopify Checkout Integration

Supported query parameters

The bundling widget includes support for query parameters allowing you to customize the widget behavior. The following table displays the query parameters that are currently supported.

ParameterDescriptionValue
viewVisualize a bundle product using the bundling widget. By passing this query parameter, the widget can omit the status validation in Recharge and show the product. The product must be active in Shopify and unpublished in Recharge. The only allowed value is recharge-bundle.

Example:

view=recharge-bundle
step (only for Multi-step layoutPreselect the initial step in the bundling widget.To select the widget, it must satisfy the following conditions:
- The step must be a number.
- The step value must exist within the available steps in the multi-step layout. Otherwise, the first step is selected.
- All the steps before the step sent in the query parameter must be completed. This means that the variant must be already selected, the bundle selection must be already completed, and any other condition must be completed. Otherwise, the last step that is pending before the step is sent will be the selected.

Example: step=3

Step 1: Select variant - Completed
Step 2: Select products - Is not completed
Step 3: confirm order - Is not completed

The step selected will be step 2.
variantPreselect the bundle variant by passing the variant ID.Example:
variant=41291293458629 where 41291293458629 is the bundle product variant ID
contentsPreselect the bundle contents by passing a value with the following format: productId:variantId:quantity

Multiple contents can be added using a comma to separate the values.

- variantId refers to the product variant ID not the bundle variant. Passing a wrong product variant can generate unexpected behavior in the widget.
- If any of the values exceeds the bundle limits, errors will display as customer advances in the widget.
contents=7200065814725:41505000095941:2
add-ons-contentsPreselect the bundle add-ons contents. This query parameter has the same structure and rules as the contents query parameter. add-ons-contents=7200065814725:41505000095941:2
cross-sells-contentsPreselect the bundle cross-sells contents. This query parameter has the same structure and rules as the contents query parameter.cross-sells-contents=7200065814725:41505000095941:2

Examples

Variant

To find the variant ID to use this query parameter:

  1. Login into your store in the Shopify partners admin.

  2. Open the products list and search for the bundle product you are working on.

  3. On the product’s details page under the variant section, click Edit on the variant to preselect.

  4. Copy the last ID in the URL to preselect the variant using the variant query parameter.

Contents

To find the product ID and product variant ID to use this query parameter:

  1. Identify the product or products you want to preselect the quantities for. In this example, the products Mint and Rosemary are used.

  2. Login into the store in the Shopify partners admin.

  3. On the product’s details page under the variant section, click Edit on the variant to preselect.

  4. Copy the product ID and product variant ID from the URL. Repeat the same process for the Rosemary product.

  5. Using the IDs collected in the step above, create a text line using the following format: productID:productvariantID:quantity.

    1. For more than one product, separate the selection using a comma. Example: contents=4595438485559:39998633836599:3,4595438682167:40022745022519:8
    2. You must send the value as variantID:variantID:quantityif your bundle is set to display variants as separate products in the Bundles widget.

Add-ons-contents

  1. Identify the product or products you want to preselect the quantities in the addons section. This example uses the Onion product.

  2. Login into the store in the Shopify partners admin.

  3. On the product’s details page under the variant section, click Edit on the variant to preselect.

  4. Copy the product ID and product variant ID from the URL.

  5. Using the IDs collected in the step above, create a text line using the following format: productID:productvariantID:quantity .

    1. For more than one product, separate the selection using a comma. Example: add-ons-contents=4595438288951:39992905302071:3
    2. You must send the value as variantID:variantID:quantityif the bundle is set to display variants as separate products in the Bundles widget.

Need Help? Contact Us