On this page9

For years, Shopify Scripts were the way Shopify Plus stores bent checkout to their rules: tiered discounts, “buy two, get one free”, hiding a shipping rate for certain postcodes, or removing a payment method for wholesale customers. They were small Ruby programs that ran on Shopify’s servers, and plenty of stores still depended on them long after the tooling around them stopped changing.
Shopify has retired Scripts. Their job now belongs to Shopify Functions, together with checkout UI extensions for anything visual. If a store’s promotions or checkout rules were built on Scripts, that logic has to be rebuilt as Functions. This is how we approach that move for our clients.
What Shopify Functions are
A Function is a small piece of code that Shopify runs inside its own infrastructure at a specific point in the checkout, such as when discounts are calculated or delivery options are shown. It’s written in JavaScript or Rust, compiled to WebAssembly, and shipped inside an app.
Compared with Scripts, Functions are:
- Fast by design: they run within strict time and memory limits, so a slow rule can’t hold up checkout.
- Configurable without code changes: merchants can manage many Functions from the Shopify admin, such as setting a discount’s threshold.
- Available beyond Plus in many cases: stores on any plan can use Functions that come from public App Store apps. Custom apps containing Functions still require Shopify Plus.
Where each type of Script goes
| What the Script did | What replaces it |
|---|---|
| Line item discounts: tiered pricing, BOGO, discounts by tag or customer | Discount Functions |
| Bundles, or changing how items appear in the cart | Cart Transform Function |
| Hiding, renaming or reordering shipping rates | Delivery Customization Function |
| Free or discounted shipping rules | Discount Functions (shipping discounts) |
| Hiding, renaming or reordering payment methods | Payment Customization Function |
| Blocking checkout, such as quantity limits or restricted addresses | Cart and Checkout Validation Function |
| Messages, banners or extra fields in checkout | Checkout UI extensions (not a Function) |
Most stores don’t need a Function for every row. Shopify’s built-in automatic discounts now cover a lot of what used to need a Script, so some rules can simply be set up in the admin.
How we run a Scripts migration
1. Write down what every Script actually does
Scripts tend to grow over the years. We read each one and list its rules in plain language, including the edge cases: what happens when two promotions overlap, which customer tags are excluded, and what the rule does with gift cards. That list becomes the test plan.
2. Check what the admin can already do
Before writing code, we check each rule against Shopify’s native discounts and settings. Anything the admin handles is cheaper to run and easier for the merchant to change later.
3. Build the rest as Functions in one app
The remaining rules go into a single custom app, with each Function exposing the settings the merchant will want to change, such as thresholds, tags and dates. We keep the logic small and well-commented, because the next person to touch it may be on the merchant’s own team.
4. Test side by side
We run the Functions on a development store with the same products, customer tags and discount codes, and check every scenario from step 1. Discount stacking deserves the most attention, because Functions combine with other discounts differently from Scripts.
5. Switch over during a quiet period
We avoid launching during a sale. After switch-over, we watch orders for the first few days to confirm the totals match what the old rules would have produced.
Common surprises
- Discount combinations change. Functions follow Shopify’s discount combination settings, so promotions that silently stacked (or didn’t) under Scripts may behave differently until those settings are configured.
- Some logic moves to the storefront. A Script could quietly change line item properties. Some of that now belongs in the theme or a checkout UI extension instead.
- Old checkout.liquid customizations need the same treatment. If the store also customized checkout.liquid, those changes need rebuilding as checkout UI extensions, usually as part of the same project.
If your store still relies on Script-era logic, or you’re not sure what your checkout rules are doing any more, we can audit them and rebuild them as Functions and checkout extensions. See our Shopify apps and checkout extensions service, or send the details through our project brief form.


