MetaDesk Global is an engineering company that builds connected IoT products, embedded firmware, AI systems, web platforms and Shopify stores for clients in North America, the UK, Australia and the Middle East.

CONTACTS
Web & Mobile App Development

Shopify Scripts to Functions: Rebuilding What Stopped on 30 June

Category
Web & Mobile App Development
Read Time
11 min read
Status
Published

Shopify Scripts stopped running on 30 June 2026. How to rebuild line item, shipping and payment logic with Shopify Functions: the API mapping, what needs no code, the limits and plan rules, and how to audit, test and roll out safely.

Shopify Scripts stopped executing on 30 June 2026, two and a half months after editing and publishing ended on 15 April. For Plus stores that had not finished moving from Shopify Scripts to Functions, nothing visibly broke. Checkout just stopped applying the tiered discounts, wholesale prices, shipping rules and payment rules the Scripts used to handle.

This guide is for those stores, and for the ones that filled the gap after the Scripts deprecation with whatever apps they could install in a week. It covers which Function API replaces each Script type, what needs no code, the limits that catch Ruby-era logic, how to audit the old Scripts, and how to roll out the replacements.

Mapping

What Shopify Scripts Did and the Functions That Replace Them

Scripts were Ruby programs, available only on Shopify Plus through the Script Editor app, in three types. Line item scripts changed prices and granted discounts on cart lines. Shipping scripts renamed, hid, reordered and discounted shipping rates. Payment scripts renamed, hid and reordered payment gateways. Only one script of each type could be published at a time, so one line item script often carried several unrelated promotions.

A Function is a WebAssembly module packaged inside an app. Shopify runs it at a fixed point in checkout, passes it JSON shaped by a GraphQL input query you write, and receives a list of operations back: apply this discount, hide this rate, show this error. The Function never edits the cart itself.

Script typeFunction APIs that replace itWhat changes
Line itemDiscount Function API (product and order discounts); Cart Transform for bundles and line overridesSavings appear as discounts, not as a lower line price. Overriding a line’s price with Cart Transform needs Plus
ShippingDelivery Customization (hide, rename, reorder); the Discount Function API’s delivery target for cheaper shippingDelivery Customization cannot change a rate’s price. A cheaper rate is a discount, with its own combination rules
PaymentPayment Customization (hide, rename, reorder)The closest one-to-one mapping. Payment terms and B2B review requirements are Plus-only operations
No Script equivalentCart and Checkout ValidationBlocks checkout with an error message, for rules Scripts could only work around

If an agency built Functions for you early, check which discount API they used. Shopify deprecated the separate Product, Order and Shipping Discount Function APIs from API version 2025-04 in favour of the single Discount Function API, so apps still on the split APIs need moving.

No Code

What Native Discounts and Apps Cover Without a Custom Function

Before writing code, check how much of the old logic Shopify now handles natively. Much Script-era work existed only because native discounts used to be weak.

  • Native discounts cover amount off products, amount off the order, Buy X get Y and free shipping, as codes or automatic discounts. A customer can use up to five product or order codes and one shipping code on an order, and a store can run up to 25 active automatic discounts, app discounts included.
  • Combinations across the product, order and shipping classes are set on each discount. Shopify has been widening what can stack on the same item, so check the current combination rules for your plan before rebuilding a stacked promotion in code.
  • Checkout Blocks, Shopify’s own app, lets Plus stores build conditional order and shipping discounts, hide, rename and reorder shipping and payment methods, and set order value limits without code. It runs on Functions underneath.
  • Public App Store apps that contain Functions work on every plan. They run on the same APIs, so the limits below apply to them too.

The plan rule decides a lot. Only Plus stores can use custom apps that contain Functions. Every store that ran Scripts was on Plus, so custom Functions are open to you unless the store has since moved down a plan.

When to build a custom Function

An app is the right answer when the rule is common and the app’s settings express it exactly. Build your own when the rule depends on your data (customer tags, metafields, B2B company records), when two apps would both discount the same cart, or when the rule carries enough revenue to deserve version control and tests. A custom Function is small but it is still software, and it needs the review and release process of any other custom app development. Weighing an app subscription against code you own is a normal part of scoping Shopify development work.

Limits

Shopify Functions Limitations That Catch Script Logic

Functions can be written in any language that compiles to WebAssembly, and Shopify provides templates for Rust and JavaScript. JavaScript is compiled with Javy, which bundles a JavaScript engine into the module, so the same logic uses more instructions, and Shopify strongly recommends Rust to avoid failures on large carts. JavaScript is fine for short rules; Rust is safer for anything that loops over every line with nested conditions.

LimitValue (November 2026)What it tends to break
Instructions per run11 million for carts up to 200 lines, scaling above thatNested loops over lines, tags and collections, mostly in JavaScript
Input size128 kBQueries that pull several metafields for every line
Output size40 kBPrice changes on every line of a large cart
Compiled module256 KiBHeavy dependencies
Input query3,000 bytes and a cost of 30Each metafield, tag check or collection check costs 3, so ten of them use the whole budget
Metafield valuesValues over 10,000 bytes are not returnedLarge JSON configuration blobs arrive as null
Active Functions25 each for discounts, delivery, payment and validation; one Cart Transform per appStores that replaced one Script with dozens of single-rule discounts

Two behaviours matter more than the numbers. First, failure is quiet. If a discount Function errors or runs out of instructions, Shopify discards its output and checkout carries on without the discount. Validation Functions also let checkout proceed after a failed run unless blockOnFailure was set. Second, Functions cannot call your servers during checkout. A fetch target exists, but only for custom apps on enterprise stores after a network access request, so most rules must work from data already in Shopify, usually metafields kept current by a separate sync.

Subscriptions need their own plan: Cart Transform operations are rejected at checkout when a selling plan is present, and Cart and Checkout Validation lists subscriptions as unsupported.

Audit

Auditing Old Scripts Before a Shopify Scripts Migration

A Shopify Scripts migration most often fails here, because the people who wrote the Ruby have moved on and the promotions calendar never matched the code. Rebuild the inventory from several sources.

  • The Scripts customizations report. Shopify released it in February 2025. It listed the Script customizations active on a store and recommended a Functions or app replacement for each. If you exported it, start there; if it is still visible in your admin, export it now.
  • The Ruby source. The Script Editor app was retired along with Scripts, so the copy that matters is whatever your team or agency kept in version control or a shared drive.
  • Order history before 30 June. Discount names, shipping rate titles and payment gateways on orders show what the Scripts actually did. Every customer tag used for pricing (wholesale, staff, VIP) is probably another rule.

Write each rule as one line: trigger, condition, effect, exceptions, and how it combines with other discounts. Then map it.

Common Script use caseFunctions replacementNotes
Tiered spend discountNative order discounts, or a Discount Function (order class)A Function when tiers depend on customer tags, markets or metafields
Wholesale or VIP pricing by customer tagDiscount Function (product class), or B2B cataloguesA Function shows a discount; a catalogue shows a different price
Free gift above a thresholdNative Buy X get Y, or a Discount FunctionA Function can discount the gift to zero but cannot add it; theme or cart code adds it
Bundle sold as one line, or split into componentsCart Transform (linesMerge, lineExpand)Rejected at checkout when a selling plan is present
Line price overrideCart Transform (lineUpdate)Plus and development stores only
Hide express shipping for PO boxes or heavy cartsDelivery CustomizationHides, renames and reorders; cannot reprice
Discounted shipping for membersDiscount Function (delivery target), or native free shippingIf issued as a code, it uses the order’s one shipping code
Hide cash on delivery above an order valuePayment CustomizationHiding a method maps directly; hiding specific placements is Plus-only
Quantity limits, or products restricted by regionCart and Checkout ValidationSet blockOnFailure if a failed run must stop checkout
Keep codes off sale itemsNative eligibility rules, or exclusions inside your own Discount FunctionDiscount Functions run concurrently and cannot see each other
Rollout

Testing and Rolling Out Shopify Functions Safely

1Build against real data
Use a development store loaded with your actual products, collections, customer tags and metafields. Fake data hides the cases that break.
2Turn every rule into test carts
For each rule, build carts just below, at and just above each threshold, plus every exception. A spend rule with three tiers needs at least nine carts before anyone touches production.
3Run them from the CLI
shopify app function run executes a Function against a JSON input and reports measurements such as the instruction count; shopify app function replay re-runs inputs logged during app dev. Keep the test carts in CI.
4Test the largest cart you sell
Run a cart at 200 lines and one above it, and record the instruction count. If a JavaScript Function sits close to the limit, port it to Rust before launch, not after.
5Release behind a gate
Have the Function act only for customers with a test tag, or ship it first as a code-based discount, then switch to automatic once orders match expectations.
6Watch the first two weeks
Check each app’s Functions page under Settings > Apps for error warnings, read the run logs in the Dev Dashboard, and compare discount per order with the weeks before 30 June.
Recovery

If Your Shopify Scripts Stopped on 30 June and Nobody Noticed

When Scripts stopped, checkout kept completing; it simply stopped applying the rules. A wholesale buyer paid retail, a heavy parcel got a rate that loses money, or cash on delivery appeared on a high-value order. Five months on, run these checks:

  • Compare discount as a share of revenue, and average discount per order, for July to November against the same weeks before 30 June. A step change on 30 June is the signature.
  • Place test orders as each customer type you used to treat differently: wholesale, staff, VIP and each market.
  • Price a domestic cart, an international cart, a PO box address and your heaviest cart, and compare the rates and payment methods shown with what the Scripts used to allow.
  • List every app that now creates discounts or customisations. Two apps covering the same rule run independently and may both apply.
  • Search support tickets since July for “discount not applied”, “wrong price” and shipping complaints, and check email flows that still promise Script-era offers.

Fix revenue leaks first, then shipping margin, then presentation issues such as rate names and payment order.

FAQ

Frequently Asked Questions

What replaced Shopify Scripts?
Shopify Functions. Discounts move to the Discount Function API, shipping rules to Delivery Customization, and payment rules to Payment Customization, with Cart Transform and Cart and Checkout Validation covering bundles and checkout rules. Functions run inside apps, either public App Store apps or custom apps.
Can Shopify Scripts still be edited or run?
No. Editing and publishing ended on 15 April 2026, and all Scripts stopped executing on 30 June 2026. The Script Editor app has been retired, so the logic must be rebuilt as Functions or replaced with an app.
Do Shopify Functions require Shopify Plus?
Public App Store apps that contain Functions work on any plan. Custom apps that contain Functions require Plus, and some operations, such as Cart Transform price overrides and payment terms, are Plus-only even in public apps.
Should I write Shopify Functions in Rust or JavaScript?
Both compile to WebAssembly. Shopify strongly recommends Rust because JavaScript carries an embedded engine and reaches the 11 million instruction limit sooner on large carts. JavaScript suits short rules; Rust suits heavy per-line logic.
Can a Shopify Function change a product’s price like a line item Script?
Mostly not. Discount Functions apply discounts, which appear as discounts on the order rather than as a new price. Cart Transform’s lineUpdate operation can override a line’s price, title or image, but only on Plus and development stores.
What happens if a Shopify Function fails at checkout?
For discounts, Shopify discards the Function’s output and checkout continues without the discount. Validation Functions also let checkout proceed unless blockOnFailure is set. Monitor run logs, because customers rarely report a discount they did not know about.
Wrapping Up

Conclusion

Moving from Scripts to Functions is less a code translation than a re-specification. Ruby that edited the cart becomes a set of narrow Functions that propose operations, each with its own limits and failure behaviour. Stores that write down what the Scripts did, use native features where they fit, and keep custom Functions for rules that depend on their own data end up with logic that is easier to test than the Scripts ever were.

If discounts, rates or payment rules went quiet on 30 June, your order data already shows where to start. We rebuild Script logic as tested Shopify Functions as part of our Shopify development services.

About MetaDesk Global

Engineering the Next Generation of Connected Products

MetaDesk Global helps startups and enterprises develop intelligent connected products that combine embedded systems, Industrial IoT, Edge AI, and cloud technologies. Our expertise includes:

Industrial IoT (IIoT) Solutions Embedded Firmware Development Edge AI Development Predictive Maintenance Systems PCB Design IoT Gateway Development Cloud Integration OTA Firmware Updates AIoT Product Development End-to-End Product Engineering

From hardware design to AI-powered industrial platforms, we build scalable solutions for the next generation of connected products.

Start Your Project

Building a Connected Product?

We design IIoT sensor networks, Edge AI pipelines, and secure cloud platforms — from prototype to production.

Request a Free Quote →