AgentReady
By Dylan HuntJuly 1st, 2026ShopifyFunctionsGuides

Shopify Scripts Are Gone for Good: How to Replace Your Discount Scripts

Shopify Scripts Are Gone for Good: How to Replace Your Discount Scripts

Shopify Scripts retired on June 30, 2026. The Script Editor is closed, and any code you ran there stopped running the same day. That includes the automatic discounts a lot of stores quietly leaned on for years.

Here is the part that catches people out: nothing announces it to your shoppers. A tiered discount that used to knock 15% off at $150 just does not fire anymore. The cart looks normal, the order goes through at full price, and the first sign of trouble is a support ticket or a dip in conversion you cannot immediately explain.

Discounts are also the easiest thing you had in Scripts to rebuild, and the new version is faster and works on more plans. So if you are cleaning up after the cutover, start here. This is the fast path to getting your discounts applying again.

What "Scripts are gone" actually means for your discounts

Scripts ran server-side at checkout. A discount Script read the cart and the customer, decided on a discount, and returned it. Common shapes:

  • A tiered discount based on cart total, spend more to save more.
  • An automatic percentage or fixed amount by cart value.
  • A reward for returning customers based on their order count.
  • A free gift added during a promotion.

All of that logic lived in the Script Editor, and all of it stopped on June 30. There is no partial mode and no read-only fallback. The rule is simply not evaluated, so the discount is not applied.

If you are not sure whether a Script was doing this work for you, walk through how to tell if your store uses Shopify Scripts before you change anything. It takes a couple of minutes and tells you exactly what broke.

The replacement: discount Functions

Shopify's answer is Shopify Functions, and for discounts specifically, a discount Function. It is a small app extension you build with the Shopify CLI in JavaScript or Rust. It declares the cart and customer fields it needs in a GraphQL input query, runs a run function that returns discount operations, and attaches to an automatic discount or a discount code in the admin.

The mental model barely changes from Scripts. You still look at the cart, decide a discount, and return it. What changes is that Functions run inside Shopify's checkout the same way for every buyer, they are faster, and they are not limited to Shopify Plus. The last point matters: plenty of stores that could never use the old Scripts on their plan can use discount Functions today.

How to replace your discount Scripts

The move is the same five beats every time:

  1. Create a custom app for your store, or extend one you already have.
  2. Generate a discount function with the Shopify CLI (shopify app generate extension).
  3. Request only the inputs you need in the input query. Do not pull the whole cart if you only read the total.
  4. Port your old rule into run, keeping the same threshold and the same customer-facing message.
  5. Deploy, then attach an automatic discount (or a code) to the function in the admin.

That is the shape for a straightforward tiered or cart-value discount, and it is genuinely a same-day job. The full walkthrough, with the input query and the run logic side by side with an old Script, is in replacing Shopify discount Scripts with Functions.

Two honest notes before you start. Free gifts are the one discount pattern that does not carry over cleanly, because the Script trick of rewriting a line price does not exist in Functions. You combine a discount function with a separate step that adds the gift to the cart, so plan that flow rather than assuming it maps one to one. And if you would rather not touch the CLI at all, a discount app can provide the function for you; the trade is flexibility for speed.

Get discounts back first, then the rest

Discounts are the right first migration because they are the simplest and because a broken discount is the most visible thing a shopper hits. Once your discounts apply again, work through the rest of what Scripts used to do: shipping rules move to delivery Functions, and the whole picture across discounts, shipping, and payments is laid out in the Scripts to Functions migration guide.

Every day a discount Script stays dead is a promotion that is not running and a checkout that is quietly charging full price. The rebuild is smaller than the deadline made it feel. Start with one discount, get it live, and the rest follow the same path.

If you want the discount work done properly and fast, that is what we do.

Quick answers

Frequently asked questions

Are Shopify Scripts really gone?
Yes. Scripts retired on June 30, 2026. The Script Editor is closed and Scripts no longer run at checkout, including automatic discount Scripts. Any discount logic you kept in a Script has stopped applying, and there is no extension or grace period.
Why did my automatic discounts stop working?
If a Shopify Script powered your automatic or tiered discounts, they stopped the moment Scripts retired on June 30, 2026. Shopify does not warn the shopper, so the discount simply does not apply and the order goes through at full price. The fix is to rebuild the same rule as a discount Function.
What replaces a Shopify discount Script?
A discount Function, an app extension you build with the Shopify CLI. It reads the cart and customer through a GraphQL input query, applies your rule in a run function, and attaches to an automatic discount or a discount code in the admin. The logic maps almost one to one from the old Script, and it runs on more plans.
How fast can I replace my discount Scripts?
Discounts are the most straightforward Script to move. A single tiered or cart-value discount is often a same-day job: generate the function, port the rule, deploy, and attach it in the admin. Free-gift promotions take a little longer because you also have to handle how the gift lands in the cart.
Do I need Shopify Plus for discount Functions?
No. Discount Functions run on every paid Shopify plan, so you do not need Plus and you do not need a workaround. That is one reason moving your discounts to Functions is worth doing properly instead of patching around the gap.

Shopify Scripts retires June 30, 2026

Need your checkout customizations moved to Functions in time?

Caffeine and Commerce migrates discount, shipping, and payment logic from Scripts to Shopify Functions and Checkout Blocks, so nothing breaks when the Script Editor shuts off. We can do the whole build for you, or hand you a clean plan.

Comments

Every comment here comes from a verified email. Write yours, confirm from your inbox, and it's live.

Loading comments…

Leave a comment

ShareXLinkedInFacebook

Written by Dylan Hunt, Founder, AgentReady. AgentReady measures what AI says about Shopify stores and helps teams improve the answer. See plans.