Shopify Functions, with or without code
Build Shopify Functions as rules.
SMART Functions Creator turns discounts, payment and delivery customizations, checkout validations, and cart transforms into rules you can read, and lets you write the logic in JavaScript when a rule is not enough. It is the replacement for Shopify Scripts that works on every Shopify plan.
Five Function types · rules or JavaScript · every Shopify plan · 7-day free trial
Start with the question you have
The things merchants ask us most, answered in full.
- Shopify Scripts ended: what replaces each script type
- Why only one discount applies, and how to fix it
- Quantity tiers with a fixed price per unit
- Buy X get Y and free gift offers
- A Script Editor alternative: functions in JavaScript
- Use Claude, ChatGPT, or Sidekick with your functions
- Find the real payment method name
- What a validation can block
- Function size and limits explained
- What the app does not do
Shopify Scripts ended on 2026-06-30
Line item, shipping, and payment scripts each have a Functions equivalent. We help you rebuild them.
There is no paste-your-Ruby button. What there is: a rule builder that covers what most scripts did, 50 templates for the common ones, a script editor for logic you would rather write in JavaScript, and support in the app chat or by email for the rules that are not obvious.
Line item scripts
Discount rules with Line groups, tiers, BXGY, and bundles
Shipping scripts
Delivery customizations for visibility, shipping discounts for price
Payment scripts
Payment customizations matched on the internal method name
Discount Functions
Tiers, gifts, bundles, and wholesale pricing as rules, not Ruby.
- Product, order, volume, and shipping discounts, automatic or with a code
- Percentage off, fixed amount off per unit, or a fixed price per unit
- Templates for BOGO, buy X get Y, bundles, and quantity tiers
- Line groups by product, collection, tag, SKU, variant name, metafield, or line item property
Every line item script we have seen maps onto one or two discount rules. Quantity tiers reprice all units once a threshold is reached, gifts are 100 percent discounts on a gift group, and combinations are set explicitly on every rule so you know what stacks before a customer does.
Wholesale tiers: sharpening stones
- Applies to
- Collection: Stones
- Customer
- tag is wholesale
- Tiers
- 5+ at 3.90 per unit, 50+ at 3.56 per unit
- Group by
- All products
Checkout shows: 50 x Stone 1000: 178.00 (was 235.00)
Payment and delivery customizations
Hide, move, and rename methods by condition.
- Hide Cash on Delivery above an amount or for tagged customers
- Hide Express shipping when fragile or oversized products are in the cart
- Rename methods for B2B customers or per country
- Conditions on cart total, products, tags, country, postal code, weight, and subscription presence
These replace shipping and payment scripts. Rules match Shopify's internal method names, the docs show how to find them, and the one platform limit that matters (the main credit card option on US and Canadian non-Plus stores) is stated up front rather than discovered at checkout.
Hide COD above 200
- Method
- name contains "Cash on Delivery"
- Condition
- Cart total is greater than 200
- Action
- Hide
Checkout shows: Cash on Delivery not listed for a 240.00 cart
Validation and cart transform
Stop the checkouts that should not happen, and shape the ones that should.
- Minimum quantities, quantity multiples, and per-product caps
- Block mixed carts, PO box addresses, or products a customer is not tagged for
- Your own error message, shown in the cart or at checkout
- Merge bundle lines or expand a kit into components with cart transform
Scripts could never stop a checkout. Validations can, with a message you write. Cart transform merges or expands lines so bundles look like bundles. Both run on every plan; Shopify keeps line updates for Plus and development stores.
Cases of 12 only
- Line group
- Collection: Wholesale beverages
- Condition
- Quantity is not a multiple of 12
- Message
- Order beverages in cases of 12.
- Runs on
- Checkout interaction, completion
Checkout shows: Checkout blocked at 30 units until 24 or 36
Script editor
When a rule is not enough, write it in JavaScript.
- Payment, delivery, validation, discount, and cart transform scripts
- 32 templates with their settings at the top, in plain comments
- Test on an editable sample cart before you save
- Version history with a side-by-side code compare
Your code receives the cart and returns Shopify's operations, such as hiding a payment method or blocking checkout with a message. It reads the fields of its Standard or Advanced input and fits in 10KB. It is on Lite and Pro. It does not run Ruby, so old scripts are rewritten, usually from the closest template.
Up to 5 of each product
const MAX_PER_PRODUCT = 5;
const totals = new Map();
for (const line of input.cart.lines) {
const id = line.merchandise.product?.id;
if (id) totals.set(id, (totals.get(id) || 0) + line.quantity);
}
const over = [...totals.values()]
.some((quantity) => quantity > MAX_PER_PRODUCT);
if (!over) return { operations: [] };
return { operations: [{ validationAdd: { errors: [{
message: "You can buy up to 5 of each product.",
target: "$.cart",
}] } }] };AI connections and Sidekick
Ask Claude, ChatGPT, or Cursor about your checkout rules.
- Read only or read and edit, chosen when you connect
- Functions it creates start inactive, and it can't delete any
- Every save lands in version history
- Shopify Sidekick lists and explains your functions in admin
Settings > AI connections gives you an MCP server URL and a connection key for your own AI app. The assistant builds with the same conditions and actions as the rule builder, under your plan's limits, and the app never uses your data to train AI.
Connected apps
- Claude
- Read and edit
- ChatGPT
- Read only
Asked: "Which functions hide Cash on Delivery, and when?"
Honest limits
Limits worth knowing before you build.
No gift auto-add
A Function can make a gift free, not put it in the cart. The customer or your theme adds it.
No code rejection
Neither the rule builder nor the script editor rejects an entered discount code with a message.
Combination rules are Shopify's
Check permissions on both discounts and Shopify's requirements for overlapping product, order, and shipping offers.
The full list is on what the app does not do.
At a glance
The numbers merchants check.
5 Function types
discount, payment, delivery, validation, cart transform
Every plan
Basic through Plus, one feature set, no Plus requirement for the core
From $19.99/month
7-day free trial, every feature on Lite and Pro
Ready to rebuild the logic your checkout is missing?
Install on Shopify, start from a template or a script, and ask support if a rule is not obvious. Plans from $19.99/month.
Start free trialOn the Shopify App Store · uninstall anytime