How do Shopify Scripts work and what can they customize?
Shopify Scripts are powerful customization tools available exclusively to Shopify Plus merchants, written in Ruby and executed server-side during the checkout process.
Three Types of Scripts
Line Item Scripts
Modify cart contents and pricing by:
- Creating BOGO (Buy One Get One) offers
- Applying tiered discounts based on quantity
- Bundling products with special pricing
- Hiding or showing specific line items based on conditions
Shipping Scripts
Customize shipping options in real-time:
- Offer free shipping based on cart value or customer tags
- Hide expensive shipping options for specific regions
- Rename shipping methods dynamically
- Create custom rate calculations based on product types
Payment Scripts
Control available payment methods by:
- Hiding specific payment gateways for certain products
- Requiring specific payment methods for high-value orders
- Customizing payment options based on customer groups
- Enforcing business rules for payment selection
Implementation Process
Scripts are created using the Script Editor app, tested in development stores, and deployed to production. They run automatically on every cart update, providing instant customization without impacting page load times.
Performance & Limitations
Scripts execute in milliseconds and support complex logic with conditional statements and loops. However, they have a 10-second timeout limit and cannot access external APIs or make network calls.