Using The Shopify Script Creator

In this guide we show you how to create discounted upsells and cross-sells utilizing a script creator paired with a Rebuy widget.

Strauss Van Wagenen avatar
Written by Strauss Van Wagenen
Updated over a week ago

Shopify Plus is required to make use of Shopify Scripts. As of February 13, 2023 Shopify announced that Shopify Scripts will be deprecated on August 28, 2025 and they will be moving to functions. They have since removed the Script Editor application from the Shopify app store.

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.


  • If you are not on Shopify Plus then you must create duplicate products with unique prices and common SKUs in order to create discounted upsells. You would then use a Rebuy Data Source to surface these duplicate (discounted) products via your widget.

  • Does not work with Recharge-related widgets.

Widget Set Up:

Create a widget and make it display reduced pricing:

Script Creator:

Navigate to and click "Create new" and then "Conditional Discount":

Make sure that the "Discounted Item Selector" is set to "Has Properties":

In the keys and values section, add "_widget_id" as the key and the ID of the widget you would like to discount as the value:

Customize your discount to apply, in this example ours would be a fixed percentage of 20 percent:

Click Save and Generate Script:

Copy this to your clipboard and then navigate to the Script Editor App in Shopify:

Create a new Blank Template Script and paste in the Script you just copied, and be sure to preview it in your store to test it out:

Test out your widget and see if the discount was applied:

Congratulations! You've successfully created a Shopify Discounting Script with no coding required.

More Examples:

Fixed Item Discount (This will also only apply the discount to one item):

Customer Email/Tag:

Customer Order Count (returning customers):

Cart Subtotal/Item count:

Shipping Address:


You can do all sorts of campaigns with the script creator. The set up would be very similar to the examples listed above.

Popular campaign types:

  • Conditional Discounts

  • Tiered Discounts

  • Buy X Get X (BOGO)

Important Note:

As long as the "Discountable Items Selector" is set to "Has Properties" and the key is "_widget_id" and the value is the ID of your widget, you have full control of customization with these scripts.

Did this answer your question?