FROM CACHE - en_header

Excluding discounted products from store-wide discounts and or discount codes

Boba
Shopify Partner
31 0 5

Hello, Was curious if Shopify has an official recommended approach for excluding products that have a percentage base discount applied via the Shopify Scripts API using the Script Editor app.

 

For my use case, I have two box items to choose from. A 5 qty box and a 10 qty box. You can add shirts from the store to these boxes. Each shirt and box added to the cart will have line item properties. These properties help us to group these products in the cart.

 

What I would like to do is exclude these items from receiving any other discount. I am thinking of one of two ways of doing this.

 

  1. Updating my logic in my script to check for a site-wide discount and or a discount code. If present the logic skips the applied discounts for shirts being added to a "box".
  2. Writing the logic to be smarter so as to not apply the site-wide discount and or code discount to the already discounted items. 

Is #2 even possible? Discount codes are applied once on the checkout screen. Does the cart and its scripts rerun after a code is applied? I just feel like there needs to be an easier way of checking for these things to ensure products do not receive more discounts than they're supposed to. 

Replies 0 (0)