Skip to main content
The Discount system provides powerful tools for creating promotional campaigns, discount codes, and complex pricing rules to drive sales and reward customers.

Discount Overview

Discounts in Openfront support sophisticated promotional strategies:
  • Discount Codes: Unique codes customers enter at checkout
  • Automatic Discounts: Applied automatically when conditions are met
  • Discount Rules: Flexible rules defining discount behavior
  • Conditions: Control when and how discounts apply
  • Stacking: Allow or prevent combining with other discounts
  • Usage Limits: Control total and per-customer redemptions
  • Time Restrictions: Set start and end dates

Discount List

The discount list displays all promotional campaigns:
  • Code: Discount code customers use
  • Type: Fixed amount, percentage, or free shipping
  • Value: Discount amount or percentage
  • Status: Active, scheduled, expired, or disabled
  • Usage: Times used vs. usage limit
  • Dates: Start and end dates
  • Regions: Where discount is valid

Status Filtering

Active

Currently valid discounts available for use

Inactive

Disabled, expired, or not yet started discounts

All

Complete list of all discounts regardless of status

Creating Discounts

1

Click Create Discount

Open the discount creation form.
2

Enter Discount Code

Create a memorable, unique code (e.g., “SUMMER20”, “WELCOME10”).
3

Choose Discount Type

Select fixed amount, percentage, or free shipping.
4

Set Discount Value

Enter the discount amount or percentage.
5

Configure Allocation

Choose whether discount applies to items or total order.
6

Add Conditions (Optional)

Set requirements like minimum purchase amount.
7

Set Usage Limits

Define maximum uses and per-customer limits.
8

Choose Regions

Select which regions can use this discount.
9

Set Date Range

Configure start and end dates for the promotion.
10

Create Discount

Save and activate the discount.

Discount Types

Fixed Amount Discount

Subtract a specific monetary amount:
{
  type: "fixed",
  value: 1000,           // $10.00 off
  allocation: "total",   // Applied to order total
  code: "SAVE10"
}
Examples:
  • “$5 off your order”
  • 25offordersover25 off orders over 100”
  • “$50 off first purchase”

Percentage Discount

Reduce price by a percentage:
{
  type: "percentage",
  value: 20,             // 20% off
  allocation: "item",    // Applied to each eligible item
  code: "SPRING20"
}
Examples:
  • “20% off everything”
  • “15% off sale items”
  • “30% off your first order”

Free Shipping

Waive shipping costs:
{
  type: "free_shipping",
  code: "FREESHIP",
  conditions: [
    {
      type: "minimum_amount",
      value: 5000         // $50 minimum
    }
  ]
}
Examples:
  • “Free shipping on orders over $50”
  • “Free 2-day shipping”
  • “Free shipping, no minimum”

Discount Allocation

Total Order Allocation

Discount applied to entire order total:
// Order total: $100
// Discount: $10 fixed
// Result: $90 total

{
  subtotal: 100.00,
  discount: -10.00,
  shipping: 5.00,
  tax: 9.50,
  total: 104.50
}

Item-Level Allocation

Discount applied to each eligible item:
// Item A: $50 (eligible)
// Item B: $30 (eligible)
// Item C: $20 (not eligible)
// Discount: 20% off items

{
  itemA: 50.00 - 10.00 = 40.00,
  itemB: 30.00 - 6.00 = 24.00,
  itemC: 20.00,
  subtotal: 84.00
}

Discount Conditions

Control when discounts apply with sophisticated rules:

Product Conditions

Specific Products

Apply to selected products only

Product Types

Apply to specific product types

Collections

Apply to product collections

Categories

Apply to product categories
Example:
{
  type: "products",
  operator: "in",
  products: [
    "product-id-1",
    "product-id-2"
  ],
  code: "NEWPRODUCTS20"
}

Cart Conditions

Minimum Amount:
{
  type: "minimum_amount",
  value: 5000,          // $50 minimum purchase
  operator: "greater_than"
}
Minimum Quantity:
{
  type: "minimum_quantity",
  value: 3,             // At least 3 items
  operator: "greater_than_or_equal"
}

Customer Conditions

Customer Groups:
{
  type: "customer_groups",
  operator: "in",
  groups: [
    "vip-customers",
    "wholesale"
  ]
}
First-Time Customers:
{
  type: "customer_type",
  value: "new",
  code: "WELCOME15"
}
Returning Customers:
{
  type: "customer_type",
  value: "returning",
  minimumOrders: 1
}

Usage Limits

Total Usage Limit

Limit overall discount redemptions:
{
  usageLimit: 100,       // Can be used 100 times total
  usageCount: 23,        // Used 23 times so far
  remaining: 77          // 77 uses remaining
}

Per-Customer Limit

Limit uses per individual customer:
{
  usageLimit: 1,         // Once per customer
  perCustomerLimit: true
}
Use Cases:
  • First-time customer offers (1 use per customer)
  • Referral rewards (1 use per referral)
  • Loyalty rewards (unlimited total, 1 per customer)
  • Flash sales (limited total uses)

Time-Based Discounts

Scheduled Discounts

Set specific start and end times:
{
  code: "BLACKFRIDAY",
  startsAt: "2024-11-29T00:00:00Z",
  endsAt: "2024-12-01T23:59:59Z",
  timezone: "America/New_York"
}

Valid Duration

Discount valid for a period after first use:
{
  code: "TRIAL30",
  validDuration: "P30D",  // Valid for 30 days
  startsAt: null,         // Starts on first use
  endsAt: null
}

Always Active

No time restrictions:
{
  code: "ALWAYSAVE10",
  startsAt: null,
  endsAt: null,
  validDuration: null
}

Stacking Discounts

Control whether discounts can be combined:

Stackable Discounts

Allow combining with other discounts:
{
  code: "EXTRA5",
  stackable: true,        // Can combine with others
  type: "percentage",
  value: 5
}
Example Stacking:
// Product on sale: 20% off
// Additional code: EXTRA5 (5% off)
// Result: 25% total discount

originalPrice: 100.00
saleDiscount: -20.00    (20%)
codeDiscount: -4.00     (5% of $80)
finalPrice: 76.00

Non-Stackable Discounts

Only one discount applies:
{
  code: "BIGSALE50",
  stackable: false,       // Cannot combine
  type: "percentage",
  value: 50
}
When multiple non-stackable discounts are available, the system automatically applies the most beneficial one for the customer.

Dynamic Discounts

Automatically apply without requiring a code:

Automatic Application

{
  isDynamic: true,        // Auto-applied
  code: null,            // No code needed
  type: "percentage",
  value: 10,
  conditions: [
    {
      type: "minimum_amount",
      value: 10000       // Auto 10% off $100+ orders
    }
  ]
}
Use Cases:
  • Volume discounts: “10% off orders over $100”
  • Category sales: “20% off all winter items”
  • Customer tier pricing: “VIP customers get 15% off”
  • Clearance items: “50% off final sale items”

Discount Analytics

Performance Metrics

Track discount effectiveness:
{
  code: "SUMMER20",
  timesUsed: 234,
  revenue: 45680.00,
  discountGiven: 11420.00,
  averageOrderValue: 195.21,
  conversionRate: 8.2,
  roi: 4.0              // $4 revenue per $1 discount
}

Top Performing Discounts

Identify most effective promotions:
  • Highest usage count
  • Most revenue generated
  • Best conversion rate
  • Highest average order value
  • Best return on investment

Discount Communication

Promotional Messaging

Share discounts with customers:
Send discount codes via email marketing

Code Best Practices

Memorable Codes:
  • SUMMER2024 (seasonal)
  • WELCOME10 (purpose-driven)
  • FREESHIP (benefit-focused)
  • VIP15 (audience-specific)
Avoid:
  • Random strings: XK8PQN2M
  • Confusing characters: O0 or Il
  • Overly long codes
  • Offensive or inappropriate terms

Regional Discounts

Create location-specific promotions:
{
  code: "EULAUNCH",
  regions: [
    "European Union",
    "United Kingdom"
  ],
  type: "percentage",
  value: 25,
  startsAt: "2024-03-01T00:00:00Z"
}
Regional Strategies:
  • Launch promotions for new markets
  • Holiday-specific discounts by region
  • Currency-specific fixed amounts
  • Shipping promotions by location

Best Practices

  • Set clear business objectives for each discount
  • Test different discount values and types
  • Monitor impact on profit margins
  • Use discounts to move specific inventory
  • Create urgency with limited-time offers
  • Create intuitive, memorable codes
  • Use consistent naming conventions
  • Disable unused or expired codes
  • Track performance of each code
  • Avoid creating too many similar codes
  • Make discount application obvious
  • Show savings clearly at checkout
  • Provide helpful error messages
  • Allow easy code removal
  • Display terms and conditions
  • Limit usage per customer
  • Monitor for abuse patterns
  • Require account for high-value discounts
  • Set reasonable maximum discount amounts
  • Disable suspicious codes immediately

Troubleshooting

Discount code not working
  • Verify code is active and not expired
  • Check start date hasn’t passed
  • Ensure usage limit not reached
  • Confirm region matches customer location
  • Verify conditions are met
  • Check for correct code spelling
Wrong discount amount applied
  • Review discount type and value
  • Check allocation method
  • Verify condition calculations
  • Review stacking rules
  • Ensure currency is correct
  • Check for conflicting discounts
Discount not showing in checkout
  • Confirm code is entered correctly
  • Check discount status is active
  • Verify customer meets conditions
  • Review product eligibility
  • Ensure cart meets minimum requirements
  • Clear browser cache and retry
Multiple discounts applying incorrectly
  • Review stacking settings
  • Check priority/precedence rules
  • Verify each discount’s conditions
  • Test discount combinations
  • Review allocation methods

Build docs developers (and LLMs) love