Expertise·E-commerce

Discount Engine

Create a flexible discount system supporting percentage off, fixed amounts, buy-one-get-one, tiered thresholds, and complex conditional…

You say
Buy it · $12 Read it before you buy $12 Written by finsilabs · unverified publisher
Context cost
6.9k tokensestimated from the bundle, loaded when it triggers
Bundle
8 files · 27.7 kBtext throughout, nothing executable
Licence
MITpaid listing
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Create a flexible discount system supporting percentage off, fixed amounts, buy-one-get-one, tiered thresholds, and complex conditional rules

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Expertise

Domain judgement the base model does not have.

discountspricingpromotionscart
Filed under

E-commerce

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md11.2 kB · 232 lines
--- name: discount-engine description: "Create a flexible discount system supporting percentage off, fixed amounts, buy-one-get-one, tiered thresholds, and complex conditional rules" category: pricing-promotions risk: critical source: curated date_added: "2026-03-12" tags: [discounts, promotions, pricing, coupons, bogo, tiered-pricing, rules-engine] triggers: ["build discount system", "implement promo codes", "create discount engine", "add coupon support"] tools: [claude-code, cursor, gemini-cli, copilot, codex-cli, kiro, opencode] platforms: [shopify, woocommerce, bigcommerce, custom] difficulty: intermediate ---
15# Discount Engine
16
17## Overview
18
19A discount engine evaluates promotions against a cart and applies the right discounts in the right order. Every major e-commerce platform has one built in — you should configure the platform's native system before considering custom code. This skill covers how to set up complex discount logic (percentage off, fixed amount, BOGO, tiered thresholds, conditional rules) on each platform, and when to use apps or plugins to extend native capabilities.
20
21## When to Use This Skill
22
23- When building a promotions system for a new e-commerce store
24- When adding coupon code support to an existing checkout flow
25- When implementing tiered pricing (e.g., buy 3+ get 10% off, buy 10+ get 20% off)
26- When creating automatic discounts that apply based on cart conditions
27- When you need BOGO, bundle, or gift-with-purchase promotions
28
29## Core Instructions
30
31### Step 1: Determine the merchant's platform and choose the right tool
32
33| Platform | Built-in Discount Capabilities | When to Add Apps/Plugins |
34|----------|-------------------------------|--------------------------|
35| **Shopify** | Automatic discounts, code-based discounts, BOGO, tiered Buy X Get Y — all in **Discounts** admin | Shopify Plus Scripts for advanced stacking and custom logic; Bold Discounts for visual rule building |
36| **WooCommerce** | Coupons (core) cover basic cases | For BOGO, tiered quantity pricing, or automatic rule-based discounts: YITH WooCommerce Dynamic Pricing & Discounts (~$70/yr) or Dynamic Pricing extension by WooCommerce (~$99/yr) |
37| **BigCommerce** | Promotions engine supports cart-level and item-level discounts, free products, BOGO | BigCommerce's built-in Promotions are powerful — use custom scripts for edge cases |
38| **Custom / Headless** | Must build — see below | N/A |
39
40### Step 2: Set up automatic discounts and BOGO on your platform
41
42---
43
44#### Shopify
45
46**Automatic discounts (no code required):**
471. Go to **Discounts → Create discount → Amount off products** (or Amount off order)
482. Toggle **No discount code** (makes it automatic — applies without a code)
493. Set the discount value and conditions
504. Under **Minimum purchase requirements**: set a minimum quantity or subtotal to trigger the discount
515. Set the **Active dates** — automatic discounts apply to all eligible carts during this window
52
53**BOGO (Buy X Get Y):**
541. Go to **Discounts → Create discount → Buy X get Y**
552. Set the **Customer buys** section: quantity and which products/collections qualify
563. Set the **Customer gets** section: quantity of free/discounted items and which products
574. Set the discount percentage (100% = free)
585. Set a **Maximum uses** limit if needed
59
60**Tiered quantity discounts (Shopify):**
61Native Shopify does not support tiered quantity breaks (e.g., 1–4 units = full price, 5–9 = 10% off, 10+ = 20% off) without an app. Options:
62- **Bold Discounts** (App Store, ~$20/month): visual interface for tiered pricing rules
63- **Wholesale Club** (App Store): adds a wholesale/tiered pricing layer for B2B
64- **Shopify Plus + Shopify Functions**: write a Discount Function in JavaScript that applies the correct tier based on cart line quantities
65
66**Stacking rules:**
67In Shopify, each discount can be configured to combine with others:
681. Edit a discount → scroll to **Combinations**
692. Toggle which discount types it can be combined with: product discounts, order discounts, shipping discounts
70
71---
72
73#### WooCommerce
74
75WooCommerce core coupons cover single-code, percentage, and fixed-amount discounts. For automatic, rule-based, and BOGO discounts, use the **Dynamic Pricing & Discounts** plugin.
76
77**Installing Dynamic Pricing:**
781. Purchase and install **YITH WooCommerce Dynamic Pricing & Discounts** or the WooCommerce-branded **Dynamic Pricing** extension
792. Go to **WooCommerce → Dynamic Pricing → Add Rule**
80
81**Creating a tiered quantity rule:**
821. Set rule type to **Product Pricing** or **Category Pricing**
832. Add pricing tiers:
84 - From 1 to 4 quantity: 0% off (full price)
85 - From 5 to 9: 10% off
86 - From 10 to 24: 20% off
87 - From 25 and above: 30% off
883. Set which products or categories this applies to
894. Save and publish
90
91**BOGO in WooCommerce:**
921. In Dynamic Pricing, create a new rule of type **Cart Pricing**
932. Set the condition: "When cart contains X of [product]"
943. Set the action: "Add Y of [product] at [0% of regular price]"
954. Or use **WooCommerce Smart Coupons** for gift-with-purchase
96
97**Preventing unintended stacking:**
98In WooCommerce core coupons, tick **Individual use only** to prevent a coupon from combining with other coupons. For automatic rules in Dynamic Pricing, each rule has a "Stops further rules" option that prevents lower-priority rules from applying.
99
100---
101
102#### BigCommerce
103
104BigCommerce has a native **Promotions** system that covers most discount scenarios.
105
1061. Go to **Marketing → Promotions → Create promotion**
1072. Set the **Promotion type**: cart-level discount, item-level discount, free shipping, free item, BOGO
1083. Configure **Conditions**:
109 - Minimum cart subtotal
110 - Specific products or categories included/excluded
111 - Customer groups (for B2B or segment-specific pricing)
1124. Set **Actions**: the discount amount and which items it applies to
1135. Set **Coupon** (optional): attach a code to require manual application, or leave blank for automatic
1146. Set **Rules** for stacking: BigCommerce allows defining whether a promotion can stack with other promotions
115
116**Tiered quantity pricing on BigCommerce:**
117Use the **Price Lists** feature (Plus plan and above):
1181. Go to **Products → Price Lists**
1192. Create a price list with explicit per-unit prices at different quantity thresholds
1203. Assign the price list to a customer group
1214. Customers in that group automatically see the tiered prices
122
123---
124
125#### Custom / Headless
126
127For custom storefronts, the discount engine evaluates applicable discounts and allocates them to cart lines. The key principles are: evaluate server-side, apply in priority order, and enforce stacking rules.
128
129```typescript
130interface Discount {
131 id: string;
132 type: 'percentage' | 'fixed_amount' | 'bogo' | 'free_shipping';
133 value: number; // percentage (0-100) or cents
134 target: 'order' | 'line_item' | 'shipping';
135 isStackable: boolean;
136 minCartCents?: number;
137 minQuantity?: number;
138 entitledProductIds?: string[];
139 excludedProductIds?: string[];
140 startsAt: Date;
141 endsAt?: Date;
142}
143
144interface CartLine {
145 id: string;
146 productId: string;
147 quantity: number;
148 unitPriceCents: number;
149}
150
151function evaluateDiscounts(
152 cart: { lines: CartLine[]; subtotalCents: number },
153 discounts: Discount[]
154): { discountId: string; amountCents: number; affectedLineIds: string[] }[] {
155 const now = new Date();
156 const eligible = discounts.filter(d =>
157 d.startsAt <= now && (!d.endsAt || d.endsAt > now)
158 );
159
160 // Sort: non-stackable first, then higher-value
161 const sorted = [...eligible].sort((a, b) => (a.isStackable ? 1 : -1) - (b.isStackable ? 1 : -1));
162
163 const applications: { discountId: string; amountCents: number; affectedLineIds: string[] }[] = [];
164 let nonStackableApplied = false;
165
166 for (const discount of sorted) {
167 if (!discount.isStackable && nonStackableApplied) continue;
168
169 // Check minimum cart value
170 if (discount.minCartCents && cart.subtotalCents < discount.minCartCents) continue;
171
172 const eligibleLines = cart.lines.filter(line =>
173 (!discount.entitledProductIds || discount.entitledProductIds.includes(line.productId)) &&
174 (!discount.excludedProductIds || !discount.excludedProductIds.includes(line.productId))
175 );
176 if (eligibleLines.length === 0) continue;
177
178 let amountCents = 0;
179 if (discount.type === 'percentage') {
180 amountCents = Math.round(
181 eligibleLines.reduce((s, l) => s + l.unitPriceCents * l.quantity, 0) * discount.value / 100
182 );
183 } else if (discount.type === 'fixed_amount') {
184 amountCents = Math.min(discount.value, cart.subtotalCents);
185 } else if (discount.type === 'bogo') {
186 const buyQty = discount.minQuantity ?? 1;
187 for (const line of eligibleLines) {
188 const freeItems = Math.floor(line.quantity / (buyQty + discount.value)) * discount.value;
189 amountCents += freeItems * line.unitPriceCents;
190 }
191 }
192
193 if (amountCents > 0) {
194 applications.push({ discountId: discount.id, amountCents, affectedLineIds: eligibleLines.map(l => l.id) });
195 if (!discount.isStackable) nonStackableApplied = true;
196 }
197 }
198
199 return applications;
200}
201```
202
203Always re-run this evaluation at order creation, not just at cart-add time, to catch race conditions and expired discounts.
204
205## Best Practices
206
207- **Always calculate discounts server-side** — never trust client-submitted discount amounts; recalculate at checkout
208- **Define stacking rules explicitly** — decide upfront whether multiple discounts can combine and document the policy for your merchandising team
209- **Cap maximum discount amounts** — for percentage discounts, set a maximum dollar cap to prevent runaway promotions
210- **Exclude sale items from additional promotions** — prevent compounding discounts from destroying margins; Shopify and WooCommerce both support "exclude sale items" rules
211- **Test rules on staging before activating** — particularly important for automatic discounts that apply to all eligible customers without requiring a code
212- **Log every discount application** — record discount ID, customer, order, and amount for audit trails and promotion ROI reporting
213- **Set clear end dates** — automatic discounts without an end date continue applying indefinitely; always set an expiry
214
215## Common Pitfalls
216
217| Problem | Solution |
218|---------|----------|
219| Discount applied after order is placed (stale cart) | Re-validate all discounts at order creation; remove expired or invalid ones before charging |
220| BOGO applied to a single-unit cart | Enforce a minimum cart quantity equal to the buy quantity before the BOGO triggers |
221| Discount causes an order total to go negative | Cap the total discount at the cart subtotal; no order total should go below zero |
222| Automatic and code-based discounts stack unexpectedly | Review the "Combinations" settings on each discount in Shopify; use "Individual use only" in WooCommerce coupons |
223| Tiered discount shows wrong tier when quantity is updated | Recalculate the applicable tier on every cart quantity change, not just at checkout |
224
225## Related Skills
226
227- @stripe-integration
228- @checkout-flow-optimization
229- @coupon-management
230- @price-rules-engine
231- @volume-pricing
232
In the file
SKILL.md1,567 words
Files8
LicenceMIT
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈160
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
6,765
on trigger
The instruction body and 7 supporting files, read only when the skill fires.
3.5%
of a 200k window
Ten skills this size would take about 35% of the window before you open a file.
050k100k150k200k context window

6.9k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Heavy. Teams tend to install this one per project rather than globally, and load it only when the job comes up.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

8 files, 27.7 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md11.2 kB
  • tile.json0.2 kB
  • evals/coupon-code-api-validation/criteria.json3.7 kB
  • evals/coupon-code-api-validation/task.md1.8 kB
  • evals/discount-data-model-and-schema/criteria.json3.7 kB
  • evals/discount-data-model-and-schema/task.md1.5 kB
  • evals/discount-evaluation-pipeline/criteria.json3.7 kB
  • evals/discount-evaluation-pipeline/task.md1.9 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 8 files you can review in full before installing. The MIT licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

$12 once
Discount Engine · MIT · finsilabs
one-time
Price$12 once
LicenceMIT — the author’s, unchanged by this purchase
Paid throughStripe, once, on the card you add at the checkout
Keeps workingfor good — the files are yours once they are on disk
Updatesevery update its author ships, delivered through this account

You can read the whole bundle before paying — the SKILL.md above is the product, not a preview of it. What the money buys is the delivery: the folder packaged and handed to your machine by key, every update its author ships, and our support if it does not do what this listing says. The terms of use are MIT, set by the author and unchanged by buying it here.

Payment runs through Stripe, on a page like this one rather than a redirect. Once there is an account it joins the same mcprush invoice as everything else you run, so there is never a second card to enter.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
Price$12
Referencefinsilabs/discount-engine

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Who wrote it

FI
finsilabs

Publishes on mcprush.

0 servers listed1 skill listednot claimed
Profile
Publisher
Servers0