Affiliate Marketing Flow
Flow Overview
Process Description
-
Affiliate Role Assignment
- Customer is assigned affiliate_marketer role
- System configures:
- Affiliate percentage for commission
- Affiliate active status
- Option for all items or specific items
-
Product Assignment
- If affiliated_all_items is true:
- Marketer can promote all available products within a certain category in affiliateAllowedCategory() function
- If affiliated_all_items is false:
- Specific products are assigned via AffiliatedItem
- If affiliated_all_items is true:
-
Sales Process
- Customer visits with affiliate's ref code
- Products added to cart with ref code
- Upon successful order:
- Commission calculated based on affiliate_percentage
- affiliated_sales_amount updated
- affiliated_sales_unpaid_amount increased
-
Payment Processing
- Admin reviews unpaid amounts
- Creates AffiliatedPayment record
- Updates affiliated_sales_unpaid_amount
- Stores payment receipts and details
Statistics Tracking
-
Sales Tracking
- Total sales amount (affiliated_sales_amount)
- Pending payments (affiliated_sales_unpaid_amount)
- Number of successful referrals
-
Product Performance
- Tracks sales per affiliated product
- Monitors conversion rates
- Records customer engagement
Key Models
-
Customer (Affiliate):
- affiliate_percentage for commission rate
- affiliated_all_items flag
- affiliated_sales_amount total
- affiliated_sales_unpaid_amount pending
- affiliate_active status
-
AffiliatedItem:
- Links products to affiliate
- Tracks usage and performance
- Manages product-specific details
-
AffiliatedPayment:
- Records payment transactions
- Stores payment receipts
- Maintains payment history