How to use Shopify Scripts to create a gift with purchase (GWP)


Jaap Vergote


June 1, 2022

You’ll need Shopify Plus to use Shopify Scripts.

We’ll create a GWP in two steps:

  • Creating a GWP upsell offer
  • Creating a script that makes it free

1/ Creating a GWP upsell offer

To create an upsell offer, install the UpsellPlus app and create your first offer.

Choose the product you want to upsell and style the widget. 

Then add the compare at price of $0 or 0%. This will make sure the price is displayed as $0.

2/ Creating a script that makes the offer free

We’ll use a script creator to do this. Go to > Create new > Conditional Discount

For the Discounted Item Selector, select Product ID

Add the product ID of the product you’d like to offer as a GWP. Set the percentage discount to 100% and give it a message. 

This guide covers how you can find the product ID:

Click Save.

Generate the script and copy it to your clipboard:

Great, you’re almost there! Now go to the Shopify Script Editor App in your Shopify store under Apps:

Create a new Percentage off a product.

Give the script a title (ex: GWP). Paste the script you just copied. Test it on your online store to see if the discount applies. If all works well, you can Save and publish!

Congrats! You just created a GWP with Shopify Scripts and UpsellPlus.

If you're looking for help with this, we offer custom script services:

← BACK to Blog

Join 1000+ brands already using UpsellPlus

The world's greatest Shopify Plus brands use UpsellPlus. Join us today!

Try for free