Personalized checkout and custom promotions with Shopify Scripts
Hi, I need the ability to disable all coupon codes, even the ones generated by affiliate and reward apps, for select products that are On-Sale. If you have the ability to apply to a collection, that would be great.
The problem that is happening is, discount codes generated by apps don't have a setting or a rule that prevents codes from being used on Sale Items.
Any help is greatly appreciated!
I just found this code that works (below). Can someone modify it so it can block by TAG or COLLECTION?
productId = 10199241991 Input.cart.line_items.each do |line_item| product = line_item.variant.product puts product.id next if product.gift_card? next unless product.id == productId case Input.cart.discount_code when CartDiscount::Percentage Input.cart.discount_code.reject({message: "Cannot be used with this product"}) end end Output.cart = Input.cart
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025