All Collections
Discounting
Shopify Script Overviews
Create a discounting Script that only applies if enough Bundle items remain in cart
Create a discounting Script that only applies if enough Bundle items remain in cart

This article will guide you on how to conditionally discount your bundles only when they remain unbroken or have a minimum number of items.

Jason Khan avatar
Written by Jason Khan
Updated over a week ago

How to create a Rebuy Bundle widget.

Please use the link below to assist you in creating your Rebuy Bundle widget.

Leveraging the Shopify Script Creator.

Now that you've created your Bundle widget, you need to set up the discounting logic.

Rebuy does not discount products. All discounting is handled via Shopify using Shopify Scripts, Shopify Discounts or alternatively, creating a duplicate product set to the discounted price and having the widget return that duplicate product instead of the original full priced product.

Exception: Rebuy can discount items in the Post Purchase widget.

This link will guide you on the general overview of how Scripts can work, how to access the Shopify Script creator and how to link a Rebuy widget to that script.

Configuring the Script to be conditionally based on the number of bundle items in the cart.

Simply match your settings to the image below!

  1. Cart Qualifier - Cart Has Items

  2. Quantity or subtotal - Item quantity count

  3. Match condition - Greater than or equal to

  4. Amount - XX - number of bundle items required for the discount to run

  5. Item Selector - Has Properties

  6. Key - _widget_id - ensure you copy this exactly

  7. Value - XXXXX - add your specific widget ID

These settings will configure the Script to track the bundle items from this specific widget and automatically add / remove the discount as long as the required number of bundle items are in the cart.

Testing to confirm the Script is functioning correctly

After you've created and published your Script. It's now time to test this yourself.

With your widget in preview mode (so customers don't see it while you test) add the bundle items to the cart. They should all be discounted via the Script. Now remove one or more items (based on your Script settings) and the discount should remove itself automatically.

Bundle widget items are visually discounted 50% via the widget settings.

All bundle items in the cart are discounted 50% via the Script.

Bundle items in cart are now full price after removing items to break the bundle.

Shopify Scripts is not a Rebuy product, and unfortunately, Rebuy Support is unable to create, modify, or customize Scripts to align with your specific needs.

We recommend using our guides as a helpful reference for any Script customizations you'd like to implement.

If you encounter challenges with your custom scripts, we suggest reaching out to Shopify support for assistance.

For additional details on our support scope, please consult our policy page. Your understanding is greatly appreciated.

Did this answer your question?