Discount question: 15% off AND free X

Does anyone know if it’s possible to set up a single discount which does this:

Customer orders X, and gets 15% off AND a free product, all on one discount code?

I can work out how to do either 15% off, OR a free product, but not both. I really need a single discount code as this is for one of those Perks discounts that banks etc do (10% off at Waitrose etc).

If you have Shopify Plus, you can do this. You should use Shopify Functions

Hi ChowBella,

It sounds like you’re looking for a way to have a discount code not only reduce a product’s price, but also add another product to the customer’s cart.

If so, then unfortunately, this isn’t possible in Shopify, as discounts can’t add items to the cart.

If you’re on Shopify Plus, then you can possibly do this without a Checkout extension.

I’m not sure you can use Shopify Functions for this. Typically, you can use the Cart Transform Function API to “expand” 1 item in the cart into multiple items (for example, the 15% off item, and the free product), BUT the Cart Transform Function API doesn’t have a way to see which specific discounts are being applied to an item in the cart.

Best,

Tobe