EzyStudio ADF

Migration Guide

This guide walks you through migrating your existing discount logic to Advance Discount Function. Whether you are coming from Shopify Scripts (Script Editor), native Shopify discounts, or a third-party solution, this page provides the mapping and process you need to make the transition.


From Shopify Scripts (Script Editor)

Shopify Scripts were deprecated on August 28, 2025 and will be fully removed on June 30, 2026. If you are still running Scripts, you must migrate to a Shopify Functions-based solution before that deadline.

Advance Discount Function is built on the Shopify Discount Function API (2026-01) and serves as a direct replacement for the discount logic that Scripts provided. The key architectural difference is that Scripts ran as Ruby code on Shopify’s servers, while Functions run as WebAssembly modules using Shopify’s input/output API.

Concept Mapping

The following table maps Shopify Script Editor concepts to their Advance Discount Function equivalents:

Script Editor ConceptFunctions EquivalentNotes
CampaignRule GroupA campaign in Scripts is roughly equivalent to a rule group — a unit of conditions plus a discount.
Customer Tag QualifiercustomerTag conditionUse the hasAny or hasNone operator. Works identically to Script tag checks.
Cart Amount QualifiercartSubtotal conditionUse numeric operators like greaterThanOrEqual.
Product Tag QualifierproductTag conditionFilters individual cart lines by tag.
Collection Qualifiercollection conditionUse inAny, inAll, or inNone operators with collection IDs.
Discount (percentage)discount.type: "percentage"Same concept, specified in the discount value object.
Discount (fixed amount)discount.type: "fixedAmount"Same concept, specified in the discount value object.
Tiered Discount (by qty)Tiered Discount FunctionUse the Tiered function with thresholdType: "quantity".
Tiered Discount (by spend)Tiered Discount FunctionUse the Tiered function with thresholdType: "subtotal".
BOGO / Free GiftBuy X Get Y FunctionUse the BXGY function with buy/get filters.
Reject Discount CodeRejection RuleAdd a rejection rule with conditions that block codes.
Script PriorityStrategy + Rule Group OrderUse "first" strategy and order rule groups by priority.
Line Item LoopProduct-Level ConditionsProduct-level conditions evaluate per cart line automatically; no explicit loop needed.
Customer Segment CheckcustomerOrderCount, customerTotalSpent conditionsMultiple condition types replace manual customer checks.

Step-by-Step Migration Process

Follow this process to migrate each Script to an equivalent Advance Discount Function configuration:

Step 1: Inventory Your Scripts

List all active Scripts in your Script Editor. For each Script, document:

  • What discount does it apply? (percentage, fixed amount, free item)
  • What conditions does it check? (customer tags, cart amounts, product tags, etc.)
  • What is the priority relative to other Scripts?
  • Is it a line item discount, order discount, or shipping discount?

Step 2: Map Each Script to a Function Type

Use the following mapping:

Script PatternRecommended Function
If condition, then flat discountConditional Discount
If condition, then escalating discount by qty/spendTiered Discount
Buy X items, get Y items free/discountedBuy X Get Y
Buy specific product combo, get bundle discountBundle Discount

If a single Script contains multiple patterns (e.g., a tiered discount with a BOGO fallback), you may need to split it into multiple discount functions.

Step 3: Create the Discount in Shopify Admin

For each Script:

  1. Navigate to Shopify Admin > Discounts > Create discount.
  2. Choose Automatic discount or Discount code (matching your Script’s behavior).
  3. Select the appropriate Advance Discount Function type.
  4. Use the rule builder UI to configure conditions, targets, and discount values based on your Script documentation from Step 1.

Step 4: Test Side-by-Side

Before disabling your Scripts:

  1. Create the new discount on a development store or in a test environment.
  2. Run through the same test scenarios you use for your Scripts.
  3. Verify that the discount amounts, qualifying items, and edge cases match.

Step 5: Switch Over

Once testing is complete:

  1. Disable the Script in Script Editor.
  2. Enable the new discount in Shopify Admin.
  3. Monitor the first several orders to confirm the discounts apply correctly.

What Cannot Be Migrated Directly

Some Script capabilities do not have direct equivalents in Shopify Functions:

Script CapabilityStatus in Functions
Arbitrary Ruby codeNot supported. Functions use a declarative JSON configuration, not custom code.
Line item price modification (set price)Partially supported via fixedAmount discount type. Direct price overrides are not available.
Payment gateway ScriptsOut of scope. Advance Discount Function handles discounts only, not payment method logic.
Shipping rate ScriptsPartially supported. Shipping discounts can reduce or eliminate shipping costs, but cannot modify rate names or add new rates.

From Native Shopify Discounts

If you are using Shopify’s built-in discount features and want more control, Advance Discount Function can replicate and extend all native discount capabilities.

What You Gain

Moving from native Shopify discounts to Advance Discount Function gives you:

Native ShopifyAdvance Discount Function
Single condition per discount18 condition types with AND/OR logic
One discount per codeMultiple rule groups per function
Basic product/order/shipping discountsTiered, BXGY, and Bundle patterns
Limited stacking controlStrategy selection + rejection rules
No customer targeting beyond segmentsCustomer tag, order count, total spent conditions

Migration Steps

  1. List your active native discounts in Shopify Admin under Discounts.
  2. Recreate each one using Advance Discount Function’s rule builder. Most native discounts map directly to the Conditional Discount function.
  3. Add the conditions you could not set before. This is where Advance Discount Function provides the most value — you can now layer multiple conditions, target specific products within a broader promotion, and control stacking behavior.
  4. Disable the native discount and activate the Advance Discount Function version.
  5. Test the replacement discount to confirm identical behavior.

Common Mappings

Native DiscountAdvance Discount Function Equivalent
”X% off entire order”Conditional: order target, percentage discount
”X% off specific products”Conditional: product target with productVariant or collection condition
”Free shipping over $X”Conditional: shipping target with cartSubtotal condition
”Buy X get Y free”Buy X Get Y function
”Amount off order over $X”Conditional: order target with cartSubtotal condition, fixed amount discount

Plan Upgrades

As your discount needs grow, you may need to upgrade your Advance Discount Function plan. Here is what becomes available at each tier:

Starter ($39/mo)

The Starter plan includes:

  • Conditional Discount and Buy X Get Y functions
  • Up to 10 rule groups across all discounts
  • All 18 conditions with AND/OR logic
  • All 3 discount classes (product, order, shipping)

This covers the vast majority of simple discount scenarios: percentage off, fixed amount off, free shipping, customer-targeted discounts.

Pro ($99/mo)

Upgrading to Pro unlocks:

  • Everything in Starter, plus:
  • Tiered Discount function — Escalating discounts based on quantity or spending
  • Up to 20 rule groups per discount
  • Rejection rules — Block discount codes when conditions are met
  • Version history — Track changes to your discount configurations over time
  • AI discount generation (credit-based) — Generate and refine configurations using natural language

If you are migrating Scripts that include tiered pricing logic, you need the Pro plan.

Enterprise ($299/mo)

Upgrading to Enterprise unlocks:

  • Everything in Pro, plus:
  • Bundle Discount function — Multi-component bundle validation and discounting
  • Up to 25 rule groups per discount
  • AI Expert mode — Access to the advanced AI model for complex discount logic
  • Priority support — Direct access to the support team for configuration help

If you are migrating complex bundle promotions or need audit trails for discount changes, the Enterprise plan provides these capabilities.


Migration Checklist

Use this checklist to track your migration progress:

  • Inventory all existing Scripts / native discounts
  • Map each discount to an Advance Discount Function type
  • Verify your plan includes the required function types
  • Create each discount in the rule builder UI
  • Test on a development store with edge cases
  • Disable old Scripts / native discounts
  • Enable new Advance Discount Function discounts
  • Monitor first orders post-migration
  • Remove deprecated Scripts before June 30, 2026 deadline

Next Steps

  • Real-World Examples — See complete configurations for common scenarios.
  • Best Practices — Learn how to structure your discounts for maintainability.
  • FAQ — Answers to common questions about Advance Discount Function.