E-commerce Glossary · 3 min read
What are Shopify Functions: Discounts?
Understanding Shopify Functions: Discounts in E-commerce
Quick Definition
Shopify Functions for discounts are small pieces of app code that Shopify runs in its own cart and checkout to work out what a shopper saves. They're also called discount functions. They let apps add discount rules beyond Shopify's built-in options, and the result acts like any other Shopify discount.
What a Discount Function Does
A discount function is a rule written in code. Shopify hands it the cart, and it sends back what to take off. That can be money off some products, the order total or shipping.
You won't ever see the code itself. It ships inside an app. You set the rule there, and the discount shows up in your Shopify admin under Discounts, either as a code or as an automatic discount.
Shopify runs the code on its own servers, then runs it again every time the cart changes. That's why it has to be small and quick. Functions replace Shopify Scripts, an older tool written in Ruby that only Plus stores could use.
Three Bags of Coffee, Run Through a Function
Example: the cheapest bag is free
A coffee store's app has one rule: buy any 3 bags, and the cheapest is free. A shopper adds bags at $14, $16 and $18, so the cart is $48. The function takes the $14 bag off. She pays $34.
Then she swaps the $14 bag for a $20 one. The cart is now $54. The function runs again, finds the $16 bag and takes that off. She pays $38.
Nobody typed a code here, since this one's automatic. Still, that free bag was 29% of her first cart. Check your margins before you pick a rule like this.
Why It Matters at the Payment Step
A price that shifts between the cart and the payment page is a surprise, and surprises give people a reason to stop. A function's discount is part of Shopify's own price math, so the saving in the cart is the same one checkout uses.
It also sticks to your combination settings. If it isn't set to combine with order discounts, the two won't both apply. To see how product, order and shipping discounts mix, read our guide to Shopify discount combinations.
Myth: Discount Functions Are a Plus-Only Perk
Lots of owners assume this, because Scripts only ran on Shopify Plus. It isn't true for Functions, though. An app from the Shopify App Store that uses them works on any Shopify plan.
Growth Suite and Shopify's Discount Function
Growth Suite, our app, builds its Volume Discount feature on Shopify's Discount Function. It shows "buy more, save more" deals on the product page, and they can work alongside the app's other discounts.
Related Terms
- Automatic Discounts: deals that apply with no code.
- Discount Code: a code shoppers enter to save.
- Discount Stacking: more than one discount on the same order.
- Discount Tier: a bigger saving at a higher spend or quantity.
- Checkout Extensibility: how apps add to Shopify checkout.
Growth Suite for Shopify
Put Shopify Functions: Discounts into practice
Ready to apply these concepts to your store? Growth Suite provides the tools you need to implement effective shopify functions: discounts strategies.
Explore more
Resources
Shopify Upselling & Cross-Selling
Most Shopify stores leave 10-30% of revenue on the table because they do not upsell or cross-sell effectively. This...
Shopify Conversion Rate: The Complete Resource Hub
Your conversion rate is the most important number in your Shopify store. Learn how to measure it, diagnose problems,...
Shopify Holiday & Seasonal Campaign Strategies
Every holiday has its own shopping psychology. Plan year-round campaigns with the right discount, right timing, and...
Shopify Countdown Timer
Adding a timer takes 5 minutes. Making it convert without destroying trust? That's strategy. The complete guide to...
Shopify Cart Abandonment
70% of Shopify carts are abandoned. Learn why customers leave, how to prevent abandonment in real-time, and recover...
Shopify Discount
Master Shopify discounts without sacrificing your profit margins. Learn strategic discount techniques, timing...