Pre-filling the bundle widget using query parameters
This guide covers how you can pre-fill the bundle widget by using query parameters.
Platforms:
- Shopify Checkout Integration
- Migrated 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.
Parameter | Description | Value |
---|---|---|
view | Visualize 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 Example:
|
step (only for Multi-step layout | Preselect the initial step in the bundling widget. | To select the widget, it must satisfy the following conditions:
Step 1: Select variant - Completed The step selected will be step 2. |
variant | Preselect the bundle variant by passing the variant ID. | Example: |
contents | Preselect the bundle contents by passing a value with the following format: Multiple contents can be added using a comma to separate the values.
|
|
add-ons-contents | Preselect the bundle add-ons contents. This query parameter has the same structure and rules as the contents query parameter. |
|
cross-sells-contents | Preselect the bundle cross-sells contents. This query parameter has the same structure and rules as the contents query parameter. |
|
Examples
Variant
To find the variant ID to use this query parameter:
-
Login into your store in the Shopify partners admin.
-
Open the products list and search for the bundle product you are working on.
-
On the product’s details page under the variant section, click Edit on the variant to preselect.
-
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:
-
Identify the product or products you want to preselect the quantities for. In this example, the products Mint and Rosemary are used.
-
Login into the store in the Shopify partners admin.
-
On the product’s details page under the variant section, click Edit on the variant to preselect.
-
Copy the product ID and product variant ID from the URL. Repeat the same process for the Rosemary product.
-
Using the IDs collected in the step above, create a text line using the following format:
productID:productvariantID:quantity
.- For more than one product, separate the selection using a comma. Example:
contents=4595438485559:39998633836599:3,4595438682167:40022745022519:8
- You must send the value as
variantID:variantID:quantity
if your bundle is set to display variants as separate products in the Bundles widget.
- For more than one product, separate the selection using a comma. Example:
Add-ons-contents
-
Identify the product or products you want to preselect the quantities in the addons section. This example uses the Onion product.
-
Login into the store in the Shopify partners admin.
-
On the product’s details page under the variant section, click Edit on the variant to preselect.
-
Copy the product ID and product variant ID from the URL.
-
Using the IDs collected in the step above, create a text line using the following format:
productID:productvariantID:quantity
.- For more than one product, separate the selection using a comma. Example:
add-ons-contents=4595438288951:39992905302071:3
- You must send the value as
variantID:variantID:quantity
if the bundle is set to display variants as separate products in the Bundles widget.
- For more than one product, separate the selection using a comma. Example:
Updated about 16 hours ago