Shopstack Work with us

Guides Build an offer

Shopify Functions discounts, explained for store owners

What a Shopify Function is

A Shopify Function is a small program that Shopify runs during checkout to change one decision. A discount Function decides which cart lines, order totals or shipping rates get money off, and how much. Shopify describes Functions as a way to "customize Shopify's backend logic".

Functions reach your store inside apps. Stores on any Shopify plan can use public App Store apps that contain Functions. Only Shopify Plus stores can use a custom app (one built just for your store) that contains Functions.

You never install a Function by itself. You install an app, and the app's Functions show up as discounts you set up in that app.

Shopify can

Shopify can’t

Why discounts moved to Functions

Before Functions, stores wrote custom discount logic as Shopify Scripts. Shopify deprecated Scripts on June 30, 2026. Scripts still published on a store were turned off, and Shopify's advice is to "transition to Shopify Functions".

  • Any plan, through public apps. An App Store app with discount Functions works on any Shopify plan.
  • One system for every discount class. One discount Function can take money off products, the order or shipping, alone or together.
  • Runs at checkout. The discount is worked out by Shopify in the cart and at checkout, with no script added to your theme pages.

What a discount Function can do

These are the discount outcomes that need a Function, because Shopify's built-in discount settings hold one rule per discount. Each one below is a discount type in Discount Genie.

  • Quantity breaks: "Buy 3, save 10%. Buy 6, save 15%." (Volume discount)
  • Spend tiers: "Spend $100, save $10. Spend $200, save $25." (Tiered order discount)
  • Buy X Get Y: classic, by volume, by purchase amount, by cart subtotal, or a bundle price.
  • Shipping discounts: free or cheaper shipping on all rates or only the rates you pick, alone or with a product or order discount.
  • Code rules: block every promo code, cap how many codes one checkout takes, or block a code by name, with your own checkout message.
  • Wholesale (B2B): volume, order and tiered discounts for your B2B customers.
  • Conditions: limit any of these by customer tag, email, Shopify Market, cart subtotal, products or collections in the cart, or subscription vs one-time purchase.

Five discounts, set up without code

Each example below is a discount a developer would otherwise write as a custom Function. In Discount Genie you open Discounts, pick the type's card under Create discounts like a Genie, and fill in the form. Every form asks for a Method (Discount code or Automatic discount), a value, the products and the customers it targets.

1. "Buy 3 totes, save 15%." Use a Volume discount.

  1. Pick the Volume card and target your tote products.
  2. Add a break that starts at 3 units, with 15% off.
  3. Save. A cart with 3 or more totes gets 15% off every tote.

2. "Spend $150, get 20% off." Use a Tiered order discount.

  1. Pick the Tiered order card.
  2. Add a tier of 20% off. A tier applies only when the subtotal is greater than its amount, and the field takes whole numbers, so enter 149 to include a cart of exactly $150.
  3. Add more tiers if you want a ladder, then save.

3. "Buy 2 shirts, get 1 free." Use Buy X Get Y.

  1. Pick the Buy X Get Y card and choose the Classic style.
  2. Set the products the customer buys (2 shirts) and the product they get (1 shirt at 100% off).
  3. Save, then test with 3 shirts in the cart.

4. "Free express shipping over $100." Use a Shipping discount.

  1. Pick the Shipping card and target Specific shipping rates: your express rate.
  2. Set the value to 100% off.
  3. Add a cart qualifier: subtotal greater than 99.99. Save.

5. "No promo codes during the sale." Use a rejection rule. Rejection rules are on every plan, Free included.

  1. Create a rejection rule and choose to block all promo codes.
  2. Write the message shoppers see when a code is turned down, for example "Codes don't apply during our sale."
  3. Save, and remove the rule when the sale ends.

Saving a discount doesn't change your product pages. Shoppers see it in the cart and at checkout. To show the offer on the product page, add a Discount Genie theme block (steps).

Limits to know

Functions have limits from Shopify, and a no-code app has limits of its own.

  • 25 discount Functions per store. Shopify lets a store activate at most 25 discount Functions, and all automatic discounts, native or app, share one limit of 25.
  • The app decides what you can build. A no-code app gives you the discount types it ships. If your idea isn't one of them, you need a developer or a different app.
  • Discount Genie covers discounts only. It does not rename, reorder or hide payment methods or shipping rates as standalone rules, and it does not block orders by ZIP code or limit quantities. It hides payment methods only inside a payment-method discount, hides delivery options only for store-pickup promos, and checks the cart at checkout only for gift with purchase.
  • No code editor. You can't write your own Function in Discount Genie. Everything is a form.
  • Product prices don't change. The discount comes off in the cart and at checkout, not on the listed price.

FAQ

Do I need to know how to code to use Shopify Functions for discounts?

No. A developer writes the Function once and ships it inside an app. You install the app from the Shopify App Store and set up each discount in its form. Writing your own Function is only needed when no app does what you want.

Shopify Scripts stopped working. How do I replace my discount Scripts?

Shopify deprecated Scripts on June 30, 2026 and points stores to Shopify Functions (Shopify Help Center). Most discount Scripts, like tiers, Buy X Get Y and code blocking, map to a Discount Genie discount type or rejection rule. Payment and shipping Scripts that rename or reorder methods need a different app. Step by step: move from Shopify Scripts to Shopify Functions.

Can I use Shopify Functions without Shopify Plus?

Yes, through a public App Store app. Stores on any plan can use public apps that contain Functions. Only a custom app built for one store needs Plus to run Functions (shopify.dev).

Is Discount Genie built on Shopify Functions?

Yes. Every Discount Genie discount type runs on Shopify Functions, Shopify's own system for custom checkout logic. You get the discount logic a developer would build as a custom Function, without writing, hosting or maintaining code.

How many discount Functions can my store run?

Up to 25 active discount Functions per store (shopify.dev). Separately, all automatic discounts, native or app, share one limit of 25 (Shopify Help Center).