Using Scripts To Exclude Products (e.g. Gift Cards) From All Discounts

Shopify Partner
4 0 1

Hi all, I'm looking to utilize a script to exclude certain products, in this case gift cards, from all discounts. I'm not really sure where to start. Hoping that someone out here with more knowledge of Ruby than I has a solution.

0 Likes
Shopify Staff
Shopify Staff
84 0 11

Hey Jay! 

This won't be necessary, as gift cards are already excluded from discount codes (except for codes that apply only, specifically, to gift cards)

Hope that helps!

0 Likes
Shopify Partner
4 0 1

Thanks for the response Guillaume. We actually have some physical gift cards from our old POS system that are in play and can still be ordered from our store. They are created as a separate product (their codes were imported via API into the gift card database when we set up our account) so they are treated as a standard product. Is there a way we can exclude them from discounts?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
84 0 11

There's currently no way to tell scripts to exclude a single line from the discount calculation; you'd have to reject the discount entirely :(. 

0 Likes