Overview
The Ecom platform provides a complete order management system that handles order creation from cart, payment processing, delivery tracking, refunds, and seller management. Orders support multiple shipping methods, payment types, and delivery options.Order Processing
Automatic order creation from cart with inventory management
Multi-Vendor Support
Separate orders per seller with commission tracking
Delivery Tracking
Real-time delivery status with carrier and delivery boy assignment
Payment Management
Multiple payment methods with status tracking
Order Model
TheOrder model represents individual orders within a combined order.
Order Relationships
Order Details
Order Details
Each order contains multiple order detail items:Location:
~/workspace/source/app/Models/Order.php:9-12Order details store individual product information including:- Product ID and variation
- Price and tax per item
- Quantity ordered
- Shipping costs
- Delivery and payment status per item
Customer & Seller
Customer & Seller
Orders link customers and sellers:Location:
~/workspace/source/app/Models/Order.php:19-27The user relationship identifies the customer, while shop identifies the seller’s shop.Shipping Options
Shipping Options
Orders support multiple shipping configurations:Location:
~/workspace/source/app/Models/Order.php:29-52Shipping Types:- Home delivery with delivery boy assignment
- Pickup point selection
- Carrier-based shipping
Refunds & Returns
Refunds & Returns
Refund request management:Location:
~/workspace/source/app/Models/Order.php:14-17Affiliate & Loyalty
Affiliate & Loyalty
Support for affiliate commissions and club points:Location:
~/workspace/source/app/Models/Order.php:39-47Order Creation
TheOrderController creates orders from cart items during checkout.
Store Method
~/workspace/source/app/Http/Controllers/OrderController.php:136-302
Key Order Creation Steps
- Validate cart - Ensure cart is not empty
- Create combined order - Parent order containing all seller orders
- Group by seller - Separate cart items by product owner
- Create seller orders - One order per seller
- Process order details - Individual line items
- Update inventory - Reduce stock quantities
- Calculate totals - Subtotal, tax, shipping, discounts
- Apply coupons - Discount codes if applicable
- Send notifications - Notify customer and sellers
Order Details Processing
~/workspace/source/app/Http/Controllers/OrderController.php:208-276
Order Listing & Filtering
The order listing supports multiple views and filters:~/workspace/source/app/Http/Controllers/OrderController.php:38-105
Delivery Status Management
~/workspace/source/app/Http/Controllers/OrderController.php:384-494
Delivery Statuses
- Pending - Order placed, awaiting processing
- Confirmed - Order confirmed by seller
- Picked - Order picked from warehouse
- On the way - Out for delivery
- Delivered - Successfully delivered
- Cancelled - Order cancelled (stock restored)
Payment Status Management
~/workspace/source/app/Http/Controllers/OrderController.php:505-563
Delivery Boy Assignment
~/workspace/source/app/Http/Controllers/OrderController.php:565-611
Order Deletion
~/workspace/source/app/Http/Controllers/OrderController.php:341-364
Tracking Code Update
~/workspace/source/app/Http/Controllers/OrderController.php:496-503
Order Features
Multi-Vendor
Automatic order splitting by seller
Stock Management
Real-time inventory updates on order
Refund Support
Wallet refunds for cancellations
Notifications
Email, SMS, and push notifications
Commission Tracking
Automatic commission calculation
Affiliate Integration
Referral code tracking per product
Related Resources
Cart & Checkout
Understand how orders are created from cart
Product Management
Learn about product stock management