Discount compounding becomes a problem when you have promotional sales activities and customers have coupon codes that were previously shared via newsletter or other channels.
You have several options to avoid “double discounting” while you run your promotion:
This can be very time consuming if you have a high number of active coupons.
- This way the customer will be able to only use 1 coupon code.
- Example: Instead of applying a 20% strike-through price, also known as sale price, you can create a coupon that provides a 20% discount on specific products. The downside here is that you don’t make the promo visible automatically in the price which will affect your promotion conversion rate.
You can install the official Shopify scripts app here (it only works for Shopify Plus plans)
REJECTION_MESSAGE = 'Discount codes cannot be used during this sale' class DisableDiscountCodesCampaign def initialize(rejection_message) @rejection_message = rejection_message end def run(cart) return if cart.discount_code.nil? cart.discount_code.reject(message: @rejection_message) end end CAMPAIGNS = [ DisableDiscountCodesCampaign.new(REJECTION_MESSAGE), ] CAMPAIGNS.each do |campaign| campaign.run(Input.cart) end
Output.cart = Input.cart
This is an example code that can be further optimized to only reject discounts on specific products or collections. If you need a special Shopify script for a specific use case, send us a message and we will help you out.
For example:
- Conditional discount – only reject coupon code if sale products are in the cart or only reject specific coupon codes.
Other Useful Shopify Scripts We Can Help You Implement
Besides blocking discount codes, we can help you implement powerful scripts and customizations to enhance your Shopify store’s performance. Examples include:
1. Tiered Discounts
- Automatically apply discounts based on cart value or item quantity:
- Spend $100, get 10% off; spend $200, get 15% off.
- Buy 2 items, get 5% off; buy 3 items, get 10% off.
2. Special Discounts for Loyalty Members
- Show exclusive discounts for specific customer tags (e.g., loyalty program members or VIPs).
- Restrict certain discount codes to members of your rewards program.
3. Buy One, Get One (BOGO) Offers
- Set up Buy One, Get One Free or Buy Two, Get One 50% Off promotions.
- Ensure offers are applied only to eligible items and avoid misuse with additional scripts.
4. Prevent Free Shipping Abuse
- Block free shipping codes for certain products or orders under a specific value.
- Restrict free shipping to specific countries or regions.
5. Dynamic Pricing Rules
- Automatically adjust prices based on cart contents or customer segments.
- Apply personalized discounts for specific shoppers.
6. Advanced Cart Rules
- Prevent checkout if a customer’s cart contains restricted products (e.g., age-restricted items).
- Add mandatory upsells when certain products are in the cart.
7. Limited-Time Offers
- Automatically expire discount codes after a specific date or number of uses.
- Create a pop-up that notifies users of an expiring deal.
8. Customized Order Minimums
- Enforce a minimum spend to apply a discount or complete a checkout.
- Highlight a progress bar in the cart showing how much more a customer needs to spend to qualify for free shipping.
9. Post-Purchase Upsells
- Add post-checkout offers for related products (e.g., “Add this item for 20% off!”).
- Seamlessly integrate apps like Rebuy or AfterSell with custom styling.
How These Scripts Can Boost Your Sales
By implementing advanced discounts like tiered pricing, BOGO offers, and special member-only promotions, you can:
- Increase your average order value (AOV).
- Drive repeat purchases with loyalty incentives.
- Prevent discount misuse during high-traffic events like Black Friday.
Case Study: Successful Sale Campaign
For one of our clients, we implemented a custom solution to block discount codes while setting up a Buy One, Get One Free promotion. This prevented stacking discounts, resulting in a 30% increase in profit margins during the event.
Get Expert Help Today
Need help creating custom discount scripts or optimizing your Shopify store? Get in touch with us today!