Back to Blog

By Dylan Hunt

May 18th, 2026

shopifyfunctionscheckoutguides

Migrating from Shopify Scripts to Checkout Functions: a practical guide

Migrating from Shopify Scripts to Checkout Functions: a practical guide

Shopify Scripts is going away. Shopify is retiring Scripts and the Script Editor on June 30, 2026, and after that date your Ruby scripts stop running at checkout. If you use Scripts today for discounts, shipping, or payment logic, you need to rebuild that logic as Shopify Functions before the deadline.

This guide explains what changes, maps each Script type to its replacement, and walks the migration in order. If you would rather hand it off, we migrate Scripts to Functions for a living.

The short version

  • What is ending: Shopify Scripts (Ruby, written in the Script Editor, Shopify Plus only).
  • When: June 30, 2026. Scripts stop executing after that.
  • The replacement: Shopify Functions, small programs you write in JavaScript or Rust that run on Shopify's own infrastructure during checkout. They are faster than Scripts, version-controlled, and available well beyond Plus.
  • What to do: identify the Scripts you run, map each to the matching Function API, rebuild and test, then remove the old Scripts.

Why Shopify is making the change

Scripts were tied to the old checkout.liquid checkout. Shopify has moved everyone to checkout extensibility, a newer, more secure, and faster checkout that Scripts cannot run on. Functions are the native way to customize that checkout. They run in milliseconds with no external network call, they are deployed as part of an app, and they work across more plans than the Plus-only Script Editor.

In other words, this is not just a forced rewrite. Functions are genuinely better: quicker, easier to test, and far less likely to silently break.

Map each Script to its Function

Most stores use one or two of the three Script types. Here is where each one goes.

Line item (discount) scripts → Discount Functions

If your Script changes prices, applies automatic discounts, gives a free gift, or rewards repeat customers, that logic moves to a product discount or order discount function. Functions can read the cart, the customer, and line item properties, the same inputs your Script used, and return discounts that show up in the cart and checkout.

This covers the most common tutorials, including automatic discounts based on cart value, discounts for returning customers, and free gifts for promotions.

Shipping scripts → Delivery customization (and delivery option) functions

If your Script hides, renames, or reorders shipping rates, that becomes a delivery customization function. If it generates custom rates based on the cart, that is a delivery option generator function. Both replace the patterns in our shipping Scripts starter.

Payment scripts → Payment customization functions

If your Script hides, renames, or reorders payment methods (for example, hiding cash on delivery over a cart threshold), that moves to a payment customization function.

How to migrate, step by step

  1. Inventory your Scripts. Open the Script Editor and list every active Script and exactly what it does. Note the inputs it reads (cart value, customer order count, tags, line item properties) and the output it produces.
  2. Match each to a Function API. Use the map above. One Script often becomes one Function.
  3. Scaffold the Function. Functions are app extensions. With the Shopify CLI you generate a function, pick the API (discount, delivery, payment), and get a working template in JavaScript or Rust.
  4. Port the logic. Rewrite the rules in the function's run entry point. The shape is familiar: read the input, decide, return operations. Most Scripts are a few lines, and the Function version is comparable.
  5. Configure inputs. Functions declare what they read through a GraphQL input query, so you request only the cart and customer fields you need. This is what makes them fast.
  6. Test in a development store. Deploy to a dev store, add the matching automatic discount or customization in the admin, and verify the behavior in a real checkout.
  7. Deploy and switch over. Roll the Function to production, confirm it fires, then delete the old Script so the two never fight.
  8. Watch the first week. Keep an eye on orders to confirm discounts and rates apply exactly as before.

Common gotchas

  • Functions are deployed through an app. You build them with the Shopify CLI and ship them as an extension, rather than pasting Ruby into the admin. If you do not have a custom app, that is the first step.
  • You attach Functions in the admin. A discount function only runs once you create an automatic discount (or a code) that points at it. A delivery or payment function runs once you add the matching customization.
  • Inputs are explicit. If a value is not in your input query, the Function cannot see it. This trips up people porting Scripts that read lots of cart data.
  • Test the edge cases. Empty carts, mixed carts, and logged-out customers behave differently. Re-test the same cases your Script handled.

Do not wait until June

Migrations always take longer than expected, and the closer you get to June 30, 2026, the busier every Shopify developer will be. Give yourself a buffer: inventory your Scripts now, migrate the highest-impact one first (usually discounts), and work down the list.

If you want this done cleanly and on time, Caffeine and Commerce migrates Shopify Scripts to Functions. Send us your Script Editor list and we will map and rebuild every one before the deadline.

Make your store agent-ready

Get found and recommended by AI shopping assistants.

AgentReady adds Schema.org structured data, an llms.txt directory, and an AI-readability audit to your Shopify store, so ChatGPT, Perplexity, and Google can understand and recommend your products. Free for stores under 500 products.

ShareXLinkedInFacebook

Written by Dylan Hunt, Founder, Caffeine and Commerce. We build Shopify stores that rank and that AI agents can read. Have a project? Get in touch.