Connect your custom bundle UI to Revy Bundles discounts (setGroup)

Looking for a Shopify bundle app that works with your own custom bundle UI? If you built your own bundle interface on your Shopify store (or use a third-party bundle builder), you can tell Revy Unlimited Bundles exactly which products belong together. This way, the app's automatic discounts are applied to the right products — even when your cart has other items in it.

You do this with one simple JavaScript command: setGroup.

⚠️ Important: setGroup does NOT add the products to the cart — it only tells Revy Bundles they belong together. Call it right before your own add-to-cart code.

What is it for?

Normally, Revy Bundles looks at your cart and matches products to your bundles automatically. That works great — but if the cart contains several products that could fit the same bundle, Revy Bundles has to guess which ones go together.

setGroup removes the guessing: you tell Revy Bundles "these specific items are one bundle", and the discount is applied to exactly those items.

Important: a group never creates a discount by itself. You still need a bundle set up in the Revy Bundles app — the group only tells Revy Bundles which cart items should be matched to it first.

When should I use it?

  • You built your own bundle UI (a custom "build your set" page, for example) and want the automatic discounts of Revy Bundles to follow the customer's selection.
  • You use a third-party bundle builder in your theme and want its sets recognized by Revy Bundles.
  • Customers can have multiple similar products in the cart and you want the discount on the ones they actually picked together.

If you use the bundle widgets of Revy Bundles, you don't need any of this — it's handled for you.

How to use it

Call it from your theme's JavaScript with the variant IDs of the products in the set, right before you add those products to the cart:

await window.RevyBundle.api.setGroup(41234567890123, 41234567890456);
// now add the products to the cart

That's it — one line. Some details:

  • Use variant IDs (the specific version of a product — size, color, etc.), not product IDs.
  • Quantity: repeat the ID. For 2x of one product and 1x of another:
    await window.RevyBundle.api.setGroup(41234567890123, 41234567890123, 41234567890456);
  • Use await (inside an async function): it makes sure the group is registered before your products are added to the cart.
  • It returns true when the group was saved, false if something went wrong.

Full example: a custom "add set to cart" button

This is what it looks like inside a typical add-to-cart handler in your theme:

async function addMySetToCart(items) {
  // items example: [{ id: 41234567890123, quantity: 2 }, { id: 41234567890456, quantity: 1 }]

  // 1. Tell Revy Bundles these items belong together
  if (window.RevyBundle && window.RevyBundle.api && window.RevyBundle.api.setGroup) {
    const groupIds = items.flatMap((item) => Array(item.quantity).fill(item.id));
    if (groupIds.length >= 2) await window.RevyBundle.api.setGroup(...groupIds);
  }

  // 2. Add the items to the cart as you normally do
  await fetch('/cart/add.js', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ items }),
  });
}

The if check makes your theme safe even on pages where Revy Bundles hasn't loaded.

How can I check it worked?

Open your browser's console on the store and run:

window.RevyBundle.api.getBundleInfo()

You'll see a grp list with the groups you registered. Then check the cart — the discount should be applied to the grouped items (if a discount matching those exist).

Good to know

  • Groups are remembered while the products are in the cart. If a customer removes a product from a group, that group is cleaned up automatically.
  • The most recently added group has priority.
  • You can register several groups (up to 12); each can hold many items.
  • A group is only a hint for matching — the bundle and its discount are still configured in the Revy Bundles app.

Want us to set it up for you? Our team is happy to add this to your theme — just reach out via the live chat in the app or email [email protected].


Frequently Asked Questions

Can I use my own custom bundle UI with a Shopify bundle app?

Yes — Revy Bundles fully supports custom bundle UIs: you design the bundle experience in your theme, and the app applies the automatic discounts. Use the setGroup JavaScript API above to tell the app which products the customer bundled together.

How do I apply automatic bundle discounts to a custom bundle builder?

Create the bundle and its discount in Revy Bundles, then call setGroup with the variant IDs from your builder right before adding the products to the cart. The discount is applied automatically at the cart and checkout — no discount codes needed.

Does this work with third-party bundle builder apps and themes?

Yes, fully. Any theme section or third-party builder that can run one line of JavaScript can integrate with Revy Bundles. If you are not sure how to add it, our team can do it for you — contact us via live chat or [email protected].

Still need help? Contact Us Contact Us