How to apply a custom discount on a product through a pre-purchase product offer extension?

Hello Shopify Community,

I am currently working on a pre-purchase product offer extension and I’m facing a challenge. I want to apply a custom discount (for example, 10%) to a product, but only when it is added to the cart via this extension.

My objective is to offer this discount on the same variant, without duplicating products or creating new variants. Essentially, I want to apply a discount to the line item in the cart but using the same product variant as the one the customer adds through the extension. This would function similarly to how selling plans work, where the same variant is used, but a discount is applied based on the method of addition.

I don’t want to duplicate products in my store to achieve this effect, so my question is:

Is there a way to apply a custom discount (e.g., 10%) to a product only when it is added through this extension, while using the same product variant without needing to duplicate the product?

If anyone has experience with this or can point me in the right direction, I would greatly appreciate it!

Thanks in advance for your help!

Hi Ismael,

If this is currently possible to achieve, you’ll need to create a discount Function - but it could depend how the pre-purchase product offer extension is set up. However it is possible for checkout extensions to interact with Shopify Functions - so you could set up logic to apply the Discount Function based on data from the extension.