Functions - 1 discount code, different discount % dependant on product

Hi - is it possible to use shopify functions so customers enter one discount code at checkout & get different %discounts dependant on products in their basket.

E.g. code is test

Products a & b are 10% off

Products c & d are 30% off

We only want customers to need to remember 1 discount code

Hi Trevor001,

Are you looking for guidance on how to code your own Shopify Function that does this, or are you looking for an existing Shopify Functions-based app that does this?

Best,

Tobe

Thank you - I’m looking to understand all options of how to achieve this - so open to all suggestions.

We have a (in development/unlisted) public functions app that can do this via product metafields to specify the discount amount - feel free to DM/contact us to get setup. We can also support custom Plus installs if you have more specialized requirements that aren’t a good fit for the public app.