Guide · apps

Moving from Shopify Scripts to Functions: what to migrate first and how

Updated 6 min read By

Short answer

Shopify Scripts stopped running on June 30, 2026, so any Script logic still missing must be rebuilt as Shopify Functions. Rebuild in order of revenue risk: discounts first, then shipping rules, then payment rules, then cart validation. Line item Scripts map to the Discount, Cart Transform and Cart and Checkout Validation APIs, shipping Scripts to Delivery Customization, and payment Scripts to Payment Customization.

Shopify Scripts, the Ruby code Shopify Plus stores used to change discounts, shipping and payment options, stopped running on June 30, 2026. If some of that logic hasn’t been rebuilt yet, your store is already running without it.

This guide covers what to rebuild first, which Shopify Functions replace each type of Script, and how to test the result before customers find the gaps for you.

What happened to Shopify Scripts, and when?

Shopify retired Scripts in two steps, and both have passed. According to Shopify’s developer changelog:

Date What changed
April 15, 2026 Editing and publishing Scripts was no longer possible
June 30, 2026 All Scripts stopped executing, and the Script Editor app was retired

There is no grace period. Any Script still published on June 30 was deactivated, so its discounts, shipping rules and payment rules simply stopped applying.

What replaces Shopify Scripts?

Shopify Functions replace Scripts. A Function is a small piece of backend logic, packaged in an app, that Shopify runs on its own infrastructure at set points in the cart and checkout.

The main differences you’ll notice:

  • Functions live in apps, not in a code editor in your admin. Either you install a public app that already does what you need, or a developer builds a custom app for your store.
  • Merchants configure them in normal admin screens. A well-built discount Function shows up as a discount your team can create, edit and schedule without touching code.
  • They compile to WebAssembly. Shopify provides templates for Rust and JavaScript and recommends Rust for performance on large carts.
  • Plan rules apply. Public apps with Functions work on any plan. Custom apps with Functions require Shopify Plus, which most former Scripts users already have.

Our Shopify Functions vs Shopify Scripts comparison goes further into the architectural differences.

Which Function replaces each type of Script?

Each of the three Script types maps to one or more Function APIs. This mapping follows Shopify’s own migration guide:

Old Script type What it usually did Function API that replaces it
Line item Script Tiered pricing, buy X get Y, VIP pricing by customer tag Discount Function API
Line item Script Building bundles or adding free items to the cart Cart Transform API
Line item Script Blocking certain carts, such as quantity limits Cart and Checkout Validation API
Shipping Script Hiding, renaming or reordering shipping rates Delivery Customization API
Shipping Script Discounting shipping rates Discount Function API
Payment Script Hiding, renaming or reordering payment methods Payment Customization API

One Script often did several of these jobs at once. A single line item Script might apply a tiered discount and block a restricted SKU combination. In that case you’ll need two Functions, one for each job.

What should you rebuild first?

Rebuild in order of revenue risk, because a missing discount costs more each day than a missing shipping label. We work through it like this:

  1. Discounts customers already expect. Tiered pricing, bundle pricing, wholesale or VIP pricing and anything advertised on your site. When these stop applying, customers abandon carts or contact support.
  2. Shipping rules that protect margin. Hiding free shipping on oversized items, restricting rates by region, or hiding expedited options for products that can’t ship that way.
  3. Payment rules that protect you from risk. Hiding cash on delivery or buy now, pay later options for certain carts, order values or regions.
  4. Validation rules. Quantity limits, restricted product combinations and purchase limits on launches.
  5. Cosmetic tweaks. Renaming or reordering rates and methods. These matter, but nothing breaks while you wait.

If you’re unsure what your Scripts did, look for a saved copy of the Ruby source in version control, developer handoff notes or old project files. Otherwise, reconstruct the rules from promotion calendars, support tickets and your marketing team’s memory.

Should you use an app or build a custom Function?

Use a public app when one covers the rule well, and build a custom Function when the logic is specific to your business. Both run the same Function technology underneath.

Situation Better fit
Standard tiered or volume discounts Public discount app
Common shipping rate hiding or renaming Public delivery customization app
Pricing tied to your own tags, metafields or customer data Custom app with Functions (Plus)
Several rules that interact, such as bundles plus tiers plus exclusions Custom app with Functions (Plus)
Rules your team must change weekly without a developer Either, as long as it has a clear admin screen

A custom app also lets you consolidate. Shopify allows a maximum of 25 active discount Functions per store, so a store that ran dozens of overlapping Script promotions should merge related rules into one configurable Function rather than rebuild them one by one.

When we build custom Functions, we also build the settings screen your team uses to manage them. That keeps day-to-day changes out of the code. Our custom app development service covers this, and the custom app cost guide explains what drives the price.

How do you rebuild a Script as a Function?

Rebuild from the rule, not from the Ruby code. Scripts and Functions work differently, so a line-by-line translation usually produces something harder to maintain. A sound process looks like this:

  1. Write each rule in plain English. For example: “Customers tagged wholesale get 20% off any product tagged bulk, but not with other discount codes.”
  2. Move rule data out of tags where it makes sense. Functions read only the fields they request, and metafields are a cleaner input than long tag strings.
  3. Pick the Function API using the mapping table above.
  4. Build and configure in a development store with your real products and customer types.
  5. Decide how it combines with other discounts. Discount Functions run at the same time and don’t know about each other. Stacking is controlled by each discount’s combination settings, so set these deliberately.
  6. Test with real orders before switching it on in production.

What breaks when Scripts are replaced with Functions?

The most common problems come from behavior the Script handled quietly that nobody wrote down. These are the ones we see most:

  • Discount stacking changes. A Script could decide exactly how promotions interacted. With Functions, combination settings decide, and the defaults may not match what you had.
  • Silent discount failures. If a discount Function fails, Shopify skips that discount and lets checkout continue. Customers simply pay more, and you hear about it from support.
  • Subscription orders. Discount Functions are not re-run when recurring subscription orders are created, so check how your subscription app handles discounts on renewals.
  • Draft orders and order edits. Some Function behavior differs on these surfaces, so test them if your team uses them for phone or wholesale orders.
  • Tag-based logic. Rules that depended on product or customer tags break when someone renames a tag. Moving to metafields reduces that risk.

How should you test Functions before they go live?

Test every rule with real checkouts, not just the cart page. For each Function, place test orders that cover:

  • Each customer type the rule targets, and one it should ignore
  • Each shipping method and destination region you offer
  • Each payment method, including Shop Pay and any buy now, pay later options
  • Combinations with your other active discounts and discount codes
  • Edge cases such as the exact quantity threshold for a tier

Then compare the first week of live orders against what you expect. Look at average discount per order and the share of orders using each shipping and payment method. A sudden shift points to a rule that isn’t firing.

Is it too late to rebuild what stopped working?

No. Scripts no longer run, but every rule they enforced can still be rebuilt as a Function or replaced by an app. The cost of waiting is the margin and conversions you lose while the rule is missing.

If your store still has gaps from the Scripts retirement, our Shopify Scripts to Functions migration covers the rule inventory, the rebuild and testing with real orders. Custom work starts with a fixed scope and price agreed in writing before we begin.

Questions we get

Can I still run or edit my Shopify Scripts?

No. Editing and publishing Scripts ended on April 15, 2026, and all Scripts stopped executing on June 30, 2026. Anything they did now has to come from Shopify Functions or an app.

Do I need Shopify Plus to use Shopify Functions?

Not always. Public apps from the Shopify App Store that contain Functions work on any plan. A custom app built for your store that contains Functions requires Shopify Plus.

How many discount Functions can a store run?

Shopify allows a maximum of 25 active discount Functions per store. Most brands need far fewer, but stores that layered many separate Scripts promotions should consolidate rather than rebuild one Function per old rule.

What happens if a Function fails at checkout?

For discount Functions, Shopify discards the failed run, does not apply that discount, and lets checkout continue. That is why a broken discount often shows up as customer complaints rather than an error.

Keep reading

Work with us

Need help with custom shopify apps & integrations?