Shopify Scripts to Functions: what changed and how to rebuild
Shopify Scripts stopped running after June 30, 2026. Checkout logic that lived in Scripts (custom discounts, tiered pricing, shipping rules, line-item changes) now has to run through Shopify Functions or a native Shopify feature. This guide explains what changed, how to find what your store lost, and how to decide what to rebuild.
What happened to Shopify Scripts?
Shopify Scripts let Plus stores run small Ruby programs at checkout. Merchants used them for discount rules, shipping changes and line-item edits that Shopify's built-in features couldn't handle at the time.
Shopify replaced Scripts with Shopify Functions, which compile to WebAssembly and run inside Shopify's own checkout. Scripts stopped running after June 30, 2026. Any Script that hadn't been replaced by then stopped applying, and checkout fell back to Shopify's default pricing and rates.
What Happens to Legacy Shopify Scripts?
How Shopify moved checkout logic from Ruby Scripts to Functions, and what that meant for stores.
How are Functions different from Scripts?
Scripts ran in a Ruby runtime that Shopify hosted separately, were edited in the Script Editor app, and were only available on Shopify Plus.
Functions are compiled to WebAssembly and deployed inside an app. Each one reads the cart through a GraphQL input query and returns the operations to apply: a discount, a changed rate, a merged bundle line. They live in version control, can be tested with sample cart data before they go live, and are switched on or off from the admin.
Which plans can use them: Functions shipped in a public app from the Shopify App Store run on any plan. Functions in a custom app built for one store need Shopify Plus.
Scripts to Functions: architecture and migration patterns
The migration process and the patterns that replace common Scripts.
How do I find out what my Scripts used to do?
Your old Scripts still tell you what checkout used to do, even though they no longer run.
- Open the Script Editor, or your store's records of it. If the app is still installed, every Script you created is listed there. If it isn't, look for exported code, developer handover notes, or the discount descriptions in old campaign briefs.
- List the Scripts that were active on June 30. Drafts and inactive Scripts weren't running, so they didn't change anything when Scripts shut down.
- Write down what each one did. Note the type (discount, shipping or line items), the rule, and anything it depended on, such as customer tags, product handles or cart totals.
- Compare against your checkout today. Build a test cart for each rule. If the discount or rate isn't there, that rule needs a native replacement or a Function.
Two simple percentage-off Scripts are an afternoon's work in the admin. Seven Scripts covering wholesale tiers and shipping overrides is an engineering project. The list tells you which one you have.
What are my options for each old Script?
Each Script falls into one of three paths.
Native replace. Shopify's Automatic Discounts, discount combinations, Quantity Rules, B2B Catalogs and shipping settings now cover many rules that once needed a Script: percentage-off, fixed-amount, buy-X-get-Y, free-shipping thresholds. You set these up in the admin, with no code to maintain.
Functions build. Rules with no native equivalent, such as quantity tiers combined with customer tags, multi-condition bundles, or rate logic across carriers, need a Shopify Function. That means writing the Function, deploying it in an app, and testing it against real cart scenarios.
Remove. Some Scripts belonged to a campaign or a test that ended long ago. They need nothing.
Sorting every Script into one of these paths before writing any code is what separates an admin task from an engineering engagement.
How is a discount Script rebuilt as a Function?
A rebuild has four stages: triage, input design, logic, and deployment.
Triage confirms what the Script did and whether any part of it is now native. A tier rule like "10% off at 5 units, 20% off at 10" may be fully covered by Quantity Rules, with no Function at all.
Input design decides what the Function needs to read from the cart: line quantities, product tags, customer tags, the cart total. That becomes its GraphQL input query.
Logic is the Function itself. It reads the input, applies the rule, and returns the discount operations. Functions can be written in Rust or JavaScript and compile to WebAssembly.
Deployment uses the Shopify CLI and an app installed on the store. The Function is tested with sample cart input first, then switched on from the admin when you're ready.
How do I migrate a discount Script to Shopify Functions (Step-by-Step)
Step by step: rebuilding a tiered quantity discount with the Discount Function API.
What about theme code left behind by Scripts-era apps?
Scripts never lived in your theme. But the apps that helped manage discounts and bundles often did: when those apps are uninstalled, their JavaScript files, Liquid snippets, stylesheets and app embeds can stay behind. That leftover code still loads on every page, even though the app it supported is gone.
If you're cleaning up checkout logic after Scripts, check the theme at the same time. It's the same list of apps.
How to Find and Remove Ghost Code from Your Shopify Theme
A step-by-step guide to identifying and removing code left behind by uninstalled Shopify apps.
Frequently asked questions
-
Do I need Shopify Plus to use Shopify Functions?
It depends where the Function lives. Functions in a public app from the Shopify App Store run on any plan. Functions in a custom app built for your store need Shopify Plus, which is where most rebuilt Script logic ends up.
-
What happened to Scripts after June 30, 2026?
They stopped running. Checkout now ignores them, so any discount, tier or rate change they applied is gone unless it was replaced with a Function or a native Shopify feature.
-
Can native Shopify discounts replace a Script?
Often, yes. Automatic Discounts, discount combinations and Quantity Rules cover percentage-off, fixed-amount, buy-X-get-Y and minimum-purchase rules without code. Checking each Script against them first keeps the rebuild as small as possible.
-
How long does a rebuild take?
It depends on how many rules there are and how they interact. One simple discount with a native replacement is a same-day admin change. Several Scripts covering wholesale tiers, bundles and shipping rules is a multi-week project. The triage gives you the scope before any build starts.