Back to Blog

By Dylan Hunt

May 25th, 2026

shopifyfunctionsguides

Replacing Shopify shipping Scripts with delivery Functions

Replacing Shopify shipping Scripts with delivery Functions

If you use a Shopify Script to control which shipping rates customers see, that code stops running when Scripts retires on June 30, 2026. The replacement is a delivery customization function, and for most stores it is a small, clean rebuild.

This is the focused version for shipping. For discounts and payments too, see the full Scripts to Functions migration guide.

What you have today

A shipping Script in the Script Editor that does one or more of:

  • Hides a rate (for example, free shipping over a threshold, or hiding express for heavy carts).
  • Renames a rate to something clearer.
  • Reorders rates so the option you want is first.

These are the patterns in our shipping Scripts starter.

What it becomes

There are two delivery-side functions, and which one you need depends on what your Script did:

  • Delivery customization function: hides, renames, or reorders the delivery options the customer already qualifies for. This replaces most shipping Scripts.
  • Delivery option generator function: creates custom rates based on the cart. Use this only if your Script was building rates from scratch rather than filtering existing ones.

A delivery customization function reads the available delivery options and the cart, then returns operations like "hide this option" or "rename this option." The decision logic, for example hide express when the cart weight is over a limit, ports directly from your Script.

The migration in five steps

  1. Create a custom app if you do not have one. Functions are app extensions.
  2. Generate a delivery customization function with the Shopify CLI.
  3. Request the inputs you need (cart, delivery options, addresses) in the function's input query.
  4. Port your rule into run: return hide, rename, or move operations against the delivery options, matching what the Script did.
  5. Deploy, then add the delivery customization in the admin so the function runs. Test against the same carts and addresses your Script handled, then delete the Script.

Watch for these

  • Like discount functions, a delivery function only runs once you create the matching customization in the admin. The extension alone does nothing.
  • Hiding the customer's only remaining rate blocks checkout. Keep at least one option available, the same trap shipping Scripts had.
  • Test by destination. Rate availability changes by country and zone, so re-run the cases your Script covered.

Want this handled

Shipping rules are easy to get subtly wrong, and a blocked checkout costs orders. We migrate shipping Scripts to delivery functions and test every destination, send us your Script Editor list before June 30, 2026.

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.