Overview
The Club Points system is a loyalty rewards program that allows customers to earn points through purchases and other activities. Points can be redeemed for discounts on future orders.Club Points help increase customer retention and encourage repeat purchases by rewarding loyal customers.
Database Structure
ClubPoint Model
Location:app/Models/ClubPoint.php:1
Relationships:
user()- BelongsTo relationship with User model (app/Models/ClubPoint.php:9)order()- BelongsTo relationship with Order model (app/Models/ClubPoint.php:13)club_point_details()- HasMany relationship with ClubPointDetail (app/Models/ClubPoint.php:17)
user_id- Customer who owns the pointsorder_id- Associated order (if points earned from purchase)points- Number of points earned or spentconvert_status- Whether points have been converted/redeemed
How Club Points Work
Earning Points
Customers can earn club points through:- Making Purchases - Points awarded based on order total
- Product Reviews - Earn points for leaving product reviews
- Referrals - Get points when referred users make purchases
- Special Promotions - Bonus points during promotional periods
Point Relationships
The ClubPoint model connects three key entities:User Balance
Each user maintains a club points balance that:- Increases when points are earned
- Decreases when points are redeemed
- Has a detailed transaction history via
club_point_details
Point Transactions
Earning Points Transaction
When a customer earns points:- Create a new
ClubPointrecord - Associate with the user and order (if applicable)
- Set positive point value
- Update user’s total balance
- Create detail records for tracking
Redeeming Points Transaction
When a customer redeems points:- Verify sufficient balance
- Create a new
ClubPointrecord with negative value - Mark as converted (
convert_status) - Update user’s remaining balance
- Apply discount to order
Club Point Details
Theclub_point_details relationship tracks:
- Individual point transactions
- Point expiration dates
- Conversion history
- Transaction descriptions
- Point sources and uses
Configuration
Point Earning Rules
Administrators can configure:- Points per currency unit - How many points per dollar/euro spent
- Minimum order value - Minimum purchase to earn points
- Product exclusions - Products that don’t earn points
- Point multipliers - Special categories with bonus points
Point Redemption Rules
- Minimum redemption threshold - Minimum points needed to redeem
- Maximum redemption per order - Cap on points usable per transaction
- Point value - Monetary value of each point
- Redemption restrictions - Products or categories where points can’t be used
Integration with Orders
Theorder() relationship links points to specific purchases:
- Tracking which orders generated points
- Viewing point history per order
- Refunding points if orders are cancelled
- Validating point awards based on order status
User Interface
Customer Dashboard
Customers can view:- Current point balance
- Point earning history
- Redemption history
- Point expiration dates
- Available rewards
Checkout Integration
During checkout, customers can:- See available points
- Choose how many points to redeem
- View discount amount
- See remaining balance after redemption
Point Lifecycle
Points Calculated
System calculates points based on:
- Order total
- Configured point rate
- Any active promotions
- Product-specific rules
Points Awarded
ClubPoint record created and linked to:
- User account
- Specific order
- Point details for tracking
Points Become Available
Points may have a validation period before use:
- Immediate availability, or
- After order is delivered, or
- After return period expires
Point Expiration
Manage point expiration throughclub_point_details:
- Set expiration dates for earned points
- Send notifications before points expire
- Automatically remove expired points
- Track expiration history
Conversion Status
Theconvert_status field tracks:
- 0 - Points are available/pending
- 1 - Points have been converted/redeemed
- 2 - Points have expired
- 3 - Points were refunded (order cancelled)
Best Practices
Point Value
Setting Point Values:
- Keep math simple (e.g., 1 point = 1)
- Make earning feel rewarding (e.g., 10 points per dollar vs 0.1 points)
- Set redemption thresholds that encourage accumulation
- Balance generosity with profitability
Communication
- Show point balance prominently in user account
- Display points earned on order confirmation
- Send emails when points are about to expire
- Highlight point value during redemption
Engagement
- Offer bonus point promotions periodically
- Create point milestones with special rewards
- Show progress toward next reward tier
- Gamify the experience with achievements
Reporting and Analytics
Key Metrics to Track
- Total points issued
- Points redeemed vs earned
- Average customer point balance
- Point liability (outstanding unredeemed points)
- Redemption rate percentage
- Most popular redemption amounts
Financial Tracking
Club points represent a financial liability:- Calculate point liability - Total unredeemed points × point value
- Track point expense - Cost of redeemed points
- Monitor point breakage - Points that expire unused
- Measure ROI - Increased customer lifetime value vs point costs
Example Scenarios
Scenario 1: Purchase Points
Scenario 2: Point Redemption
Scenario 3: Order Cancellation
Integration Points
With User Accounts
- Display point balance in account dashboard
- Show point history and transactions
- Enable point-to-wallet conversion (if supported)
With Orders
- Award points on order completion
- Allow point redemption at checkout
- Handle point refunds on cancellations
- Track point source per order
With Products
- Mark products as point-eligible or excluded
- Set bonus point multipliers per product
- Display potential points on product pages
Security Considerations
Migration and Seeding
When implementing club points:- Create database tables for ClubPoint and ClubPointDetail
- Add point balance field to users table (for quick access)
- Set up default configuration values
- Optionally award welcome bonus points to existing customers
- Create scheduled tasks for point expiration
Future Enhancements
Consider adding:- Point tiers - Silver, Gold, Platinum status levels
- Point sharing - Transfer points between users
- Point gifting - Buy points for others
- Dynamic rates - Surge point earning during slow periods
- Partner points - Earn points from affiliated services
- Charitable donations - Donate points to causes