How to create a single-tiered discount code that adjusts with cart value?

Topic summary

A user seeks to create a single discount code that automatically adjusts based on cart value (e.g., £10 off orders over £100, £15 off over £200). This is needed for a printed postcard insert, making multiple codes impractical.

Initial Response:

  • One developer suggests building a custom app with tiered logic, providing sample pseudo-code that checks cart totals and applies corresponding discounts.

Alternative Solution:

  • Another user reports success using Shopify’s native “Amount of Order” discount feature set to “Automatic” mode.
  • Create separate automatic discounts for each tier (£5 off £50, £10 off £100, £20 off £200).
  • Configure them not to combine with other order discounts.
  • The system automatically applies the appropriate tier based on cart value.

Status: The native automatic discount approach appears to solve the problem without requiring paid apps or custom development, though it uses automatic discounts rather than a single entered code as originally requested.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi There! I am trying to create a single-tiered discount code for our website that will offer a certain amount off at different spends and update automatically depending on the value.

So if they have over £100 in their cart, the code will give them £10 off. But if they add more than £200, then they get £15 off with the same code and the same in reverse.

As we are printing this code onto a small a6 postcard to go in our packs, we ideally need this as a singular code to save redesigning our entire leaflet to accommodate for multiple codes - it also makes it easier for the customer only to enter one code that auto updates.

Any help will be greatly appreciated as I have spent much of my time searching for an app that does this; I’ve found ones that do so as an automatic discount, but none that are triggered by a code.

Any help will be greatly appreciated; thanks!

Hey @KylePet ,

For creating a tiered discount system with a single code in Shopify, a custom app can be developed. Here’s a simplified pseudo-code outline to give you an idea of the logic:

def apply_tiered_discount(cart_total, discount_code):
    if discount_code == "DISCOUNTCOUPON":
        if cart_total > 200:
            return 15  # £15 off for carts over £200
        elif cart_total > 100:
            return 10  # £10 off for carts over £100
    return 0  # No discount for other cases

# Example usage
cart_total = get_cart_total()  # Function to get the total value of the cart
discount = apply_tiered_discount(cart_total, entered_code)
apply_discount_to_cart(discount)

It should be very easy and quick to develop the app. Hope this gives you a good starting point!

Did you ever figure out how to do this, without adding yet another paid app to your page?

This is actually quite straightforward but unfortunately not documented anywhere in Shopify.

If you use “Amount of Order” discount, set it to be “Automatic”. You can then choose your parameters, make sure it is set NOT to combine with other order discounts.

Create a discount for each tier ie. £5 off £50, £10 off £100, £20 off £200.

The correct discount will automatically apply relative to what value is in their basket.

Hope this helps someone in future as I couldn’t find any info on this!