Standard Shopify discount codes are limited. You can create percentage discounts, fixed-amount discounts, and free shipping codes — but you cannot create "buy 3 get the cheapest free," tiered volume pricing, customer-tag-based discounts, or conditional shipping rules. Shopify Scripts unlock all of these and more.

Scripts are small Ruby programs that run on Shopify's servers every time the cart or checkout is loaded. They execute in real time, modifying prices, shipping options, and payment methods before the customer sees them. The customer sees the final result — they never see the original price being modified by code behind the scenes.

What Are Shopify Scripts?

Shopify Scripts are Plus-exclusive Ruby programs that run server-side to modify cart contents, shipping options, and payment methods in real time. They enable dynamic pricing (BOGO, tiered discounts, loyalty pricing), custom shipping rules (free shipping for specific products, hidden methods), and payment filtering (hide COD above $500). Scripts execute in 10-50ms and have zero impact on page load speed.

Scripts are managed through the Script Editor app in your Shopify admin. The editor provides a code environment with syntax highlighting, a console for testing, and version history. Each script type (line item, shipping, payment) is managed independently.

Three Types of Scripts

Script Type What It Modifies When It Runs
Line Item ScriptsCart item prices, quantities, propertiesEvery cart update
Shipping ScriptsAvailable shipping methods and ratesAt checkout shipping step
Payment ScriptsAvailable payment methodsAt checkout payment step

Line Item Scripts — Dynamic Pricing

Line item scripts are the most powerful and most commonly used script type. They modify the price, properties, or quantity of items in the cart before the customer checks out. Here are the major use case categories:

BOGO (Buy One Get One)

Create buy-one-get-one-free, buy-two-get-one-half-off, or buy-X-get-Y-free promotions. Unlike basic discount codes, BOGO scripts can automatically identify the cheapest item in the cart and apply the discount to it, handle mixed-product BOGOs (buy any shirt, get any hat free), and stack with other promotions.

Tiered Volume Discounts

Offer automatic discounts based on the quantity of items in the cart. Example: buy 2-4 items get 10% off, buy 5-9 items get 15% off, buy 10+ items get 25% off. This is one of the most effective AOV-boosting strategies — customers see the next discount tier and add items to qualify. Stores using tiered volume discounts report 15-30% higher average order values.

Customer-Tag-Based Pricing

Offer different pricing based on customer tags. VIP customers (tagged by Shopify Flow) get 10% off everything. Wholesale customers get 40% off. Employee accounts get 50% off. First-time buyers get free shipping. Tags are assigned automatically through Flow automations, creating a seamless personalized pricing engine.

Bundle Pricing

When customers add a specific combination of products to their cart, automatically apply bundle pricing. Example: a camera body at $899 + a lens at $499 + a bag at $79 = $1,199 as a bundle instead of $1,477 separately. The script detects the combination and adjusts prices automatically.

Spend Threshold Discounts

Apply automatic discounts when the cart reaches a spending threshold. Spend $100 get 10% off, spend $200 get 15% off, spend $500 get 20% off. This works beautifully alongside an EA Free Shipping Bar showing progress toward the threshold.

Shipping Scripts — Custom Delivery Rules

Shipping scripts modify the shipping options available at checkout. They can hide, rename, reorder, or reprice shipping methods based on cart contents, customer data, or order value.

Common Shipping Script Patterns

Payment Scripts — Checkout Control

Payment scripts control which payment methods are available at checkout. This is critical for risk management, B2B orders, and regional compliance.

Common Payment Script Patterns

20 Script Examples by Use Case

Key Stat: The most impactful scripts by AOV increase are: tiered volume discounts (+15-30% AOV), spend threshold discounts (+20-35% AOV), and bundle pricing (+10-20% AOV). Combining a tiered discount script with an EA Free Shipping Bar that shows progress toward the next tier is the highest-ROI configuration we have seen.

Conversion-Focused Scripts

  1. Buy 2 Get 1 Free — Automatically discount the cheapest item to $0 when 3+ items are in cart
  2. Tiered Percentage Discount — 10% off 2 items, 15% off 3 items, 20% off 4+ items
  3. Spend $100 Save $15 — Fixed discount when cart exceeds threshold
  4. Free Gift at $75 — Auto-add a free product when cart reaches $75 (works with EA Auto Free Gift & Rewards Bar)
  5. First-Order Discount — 15% off for customers with 0 previous orders

Loyalty and Retention Scripts

  1. VIP Auto-Discount — 10% off everything for customers tagged "VIP"
  2. Birthday Discount — 20% off during the customer's birthday month
  3. Repeat Buyer Reward — 5% off for customers with 3+ previous orders
  4. Win-Back Pricing — 25% off for customers who have not ordered in 90+ days
  5. Employee Pricing — 50% off for customers tagged "employee"

Operational Scripts

  1. Maximum Discount Cap — Ensure total discounts never exceed 30% regardless of stacked codes
  2. Exclude Sale Items — Prevent discount codes from applying to products already on sale
  3. Category-Specific Discounts — 20% off collection "Summer Sale" only
  4. Minimum Purchase Enforcement — Block discount codes unless order meets $50 minimum
  5. Product Pairing Discount — 15% off accessories when purchased with a main product

Shipping and Payment Scripts

  1. Free Shipping Over $75 — Remove shipping charges for qualifying orders
  2. Hide Overnight for Oversized — Remove express options for heavy/bulky items
  3. VIP Free Express — Free express shipping for customers tagged "VIP"
  4. Hide COD Over $500 — Risk management for high-value COD orders
  5. B2B Payment Methods — Show net terms and PO payment only for wholesale customers

Scripts vs. Shopify Functions

Shopify Functions are the modern successor to Scripts, using Rust compiled to WebAssembly instead of Ruby. Here is how they compare:

Aspect Scripts (Legacy) Functions (Modern)
LanguageRubyRust / WebAssembly
Execution speed10-50ms<5ms
Where managedScript Editor appShopify CLI / App
Version controlBuilt-inGit-based
TestingConsole in editorUnit tests
Shopify recommendationMaintained, not deprecatedPreferred for new builds

Performance and Limitations

Scripts run server-side and have zero impact on page load speed. They execute only when the cart or checkout is loaded. Execution times of 10-50ms are imperceptible to customers. However, Scripts do have limitations: they cannot access external APIs, they cannot modify the storefront UI, they have limited access to historical customer data, and they run in a sandboxed Ruby environment with restricted libraries.

For UI-level changes (showing the customer how close they are to a discount tier), combine Scripts with front-end apps like the EA Free Shipping Bar or EA Auto Free Gift & Rewards Bar. Scripts handle the pricing logic; apps handle the visual communication.

ROI of Dynamic Pricing

Script Strategy AOV Impact Annual Value ($3M store)
Tiered volume discounts+15-30%$450,000-$900,000
Spend threshold discounts+20-35%$600,000-$1,050,000
BOGO promotions+10-20%$300,000-$600,000
VIP loyalty pricing+5-10% LTV$150,000-$300,000

Apps That Complement Scripts

Scripts handle the pricing logic, but customers need to see and understand the promotions. The EasyApps Ecommerce suite provides the front-end visibility:

Frequently Asked Questions

Are Shopify Scripts only available on Shopify Plus?

Yes, Shopify Scripts are exclusive to Shopify Plus. Standard plans cannot use Scripts. This is a key differentiator that justifies the Plus subscription for merchants needing dynamic pricing, complex discount logic, or custom shipping and payment rules.

What programming language are Shopify Scripts written in?

Scripts are written in Ruby, running in a sandboxed environment on Shopify's servers. Shopify Functions, the modern successor, use Rust compiled to WebAssembly for better performance. New implementations should consider Functions.

Can Shopify Scripts stack with discount codes?

Yes, Scripts can work alongside discount codes, override them, or cap maximum discounts. You have full control over how Scripts interact with other discounts, including setting maximum discount caps that prevent abuse.

Do Shopify Scripts affect page load speed?

No. Scripts run server-side during cart and checkout operations, not during page load. Execution time is 10-50ms — imperceptible to customers. Functions are even faster at under 5ms.

Should I use Shopify Scripts or Shopify Functions?

For new builds in 2026, Shopify recommends Functions. They are faster, more maintainable, and part of the Checkout Extensibility framework. Existing Scripts continue to work without a deprecation date. No urgent need to migrate working Scripts.

Make Scripts Visible to Customers — Free

Scripts handle the pricing logic. EasyApps handles the front-end: free shipping bars, reward progress, countdown timers, and announcement bars — all free.

Browse All EasyApps