Orders Page
The Orders page provides a centralized view of all orders across all your e-commerce sites with powerful filtering and search capabilities.
Overview
Navigate to Orders in the WordPress admin menu to view and manage orders from all connected BigCommerce and WooCommerce stores.
Key Features:
- 📊 Unified View - See orders from all sites in one place
- 🔍 Advanced Filtering - Filter by site, status, payment method, and shipping status
- 🔎 Quick Search - Search by order number, NAV order, or transaction ID
- 📄 Pagination - 20 orders per page for fast loading
- 👁️ Order Details - View complete order information in modal
- ⚡ Fast Performance - Optimized queries with database indexes
Interface Elements
Filter Bar
The top filter bar provides multiple ways to narrow down your order list:
Search Field
- Search for specific orders by:
- Order number
- NAV sales order number
- Transaction ID
- Press Enter or click Search button to apply
Site Filter
- All Sites - View orders from all stores
- Specific Site - Filter by individual store (shows site ID and name)
- Dropdown populated from active sites
Status Filter
- All Statuses - Show all orders
- Pending - Orders not yet imported to Business Central
- Imported - Orders successfully imported
Payment Method Filter
- All Methods - Show all payment types
- Klarna - Orders paid via Klarna
- Stripe - Orders paid via Stripe
- PayPal - Orders paid via PayPal
- Credova - Orders paid via Credova financing
- Sezzle - Orders paid via Sezzle financing
- NMI - Orders paid via NMI gateway
Shipped Filter
- All - Show all orders regardless of shipping status
- Shipped - Orders that have been shipped
- Not Shipped - Orders pending shipment
Orders Table
The main table displays 20 orders per page with the following columns:
| Column | Description |
|---|---|
| Site | Store name (e.g., "Site 1 - Main Store") |
| Order Number | Order number from e-commerce platform |
| Nav Order | NAV sales order number (if imported) |
| Payment | Payment provider (Klarna, Stripe, etc.) |
| Status | Badge showing Pending/Imported/Verified |
| Date Added | When order was created |
| Ship Status | Shipped or Not Shipped |
| Ship Agent | Shipping carrier code (e.g., FEDEX, UPS) |
| Actions | View button to open details modal |
Status Badges
Orders display colored status badges:
- 🟢 Verified (Green) - Imported and verified in Business Central
- 🔵 Imported (Blue) - Imported to Business Central, awaiting verification
- ⚪ Pending (Gray) - Not yet imported
Pagination Controls
Bottom controls for navigating through order pages:
- Previous button - Go to previous page
- Page X of Y - Current page indicator
- Next button - Go to next page
- Showing X of Y orders - Total order count
Order Details Modal
Click View on any order to open the detailed order information modal.
Order Details Card
Displays core order information:
- Order number
- Site name
- NAV order number
- Transaction ID
- Contact ID
- Status badge
Payment & Shipping Card
Shows payment and fulfillment details:
- Payment method
- Ship status (✓ Shipped or ✗ Not Shipped)
- Shipping agent and service
- Shipping cost
- Order date
- Date added to system
Line Items Table
Complete list of products in the order:
| Column | Description |
|---|---|
| SKU | Product SKU |
| Quantity | Number of units ordered |
| Price | Unit price |
| Total | Line item total (qty × price) |
Order Totals:
- Subtotal
- Tax
- Shipping
- Total (bold)
Addresses Section
Two-column layout showing:
Billing Address:
- Name
- Address lines
- City, State, ZIP
- Country
- Phone
Shipping Address:
- Name
- Address lines
- City, State, ZIP
- Country
- Phone
Common Workflows
Finding a Specific Order
By Order Number:
- Enter order number in search field
- Press Enter or click Search
- Order appears in results
By Site:
- Select site from Site dropdown
- Orders filtered to that site only
By Status:
- Select status from Status filter
- View only orders in that import state
Checking Shipped Orders
- Set Shipped filter to "Shipped"
- View all orders that have been fulfilled
- Combined with other filters for specific queries
Payment Method Reports
- Select payment method from filter
- View all orders using that payment processor
- Useful for reconciliation and reporting
Viewing Order History
- Use pagination to browse through order history
- Orders sorted by date added (newest first)
- 20 orders per page for optimal performance
Performance Notes
The Orders page is optimized for fast loading:
- Database Indexes - Critical indexes on
dateaddedandship_statuscolumns - Pagination - Only loads 20 orders at a time
- Deferred Loading - Sites dropdown loads 200ms after main content
- HTTP Caching - Sites endpoint cached for 5 minutes
Expected Load Times:
- With indexes: 0.006-0.060 seconds
- Without indexes: 0.150-1.500 seconds
See Performance Optimization for details.
Database Queries
The Orders page executes these database queries:
-
Sites Query (1 query)
SELECT * FROM rm_sites WHERE is_active = 1 ORDER BY name ASC -
Orders COUNT (1 query)
SELECT COUNT(*) FROM rm_order WHERE [filters] -
Orders SELECT (1 query)
SELECT o.*, s.name as site_name
FROM rm_order o
LEFT JOIN rm_sites s ON o.site = s.id
WHERE [filters]
ORDER BY o.dateadded DESC
LIMIT 20 OFFSET [page]
Total: 3 queries per page load
See Orders Page Query Analysis for complete breakdown.
Troubleshooting
Slow Page Load
Symptoms: Page takes >2 seconds to load
Solutions:
- Apply migration 011 to add performance indexes
- Verify indexes exist:
SHOW INDEX FROM rm_order - Check debug.log for slow queries
- See Query Logging
Orders Not Showing
Check:
- Order sync is enabled for the site (Settings → Sites)
- Cron jobs are running (Operations → Cron Jobs)
- No errors in debug.log
- Database connection is active
Filter Not Working
Check:
- Clear browser cache
- Verify JavaScript console for errors
- Check that webpack build is current:
npm run build
Status Badge Not Updating
Check:
- Business Central export has run
- Order verification has completed
- Refresh page (F5) to see latest status
Technical Details
REST API Endpoints
GET /wp-json/gsm-middleware/v1/orders
- Fetches paginated order list
- Query parameters:
page- Page number (default: 1)per_page- Items per page (default: 20)search- Search termsite- Site ID filterimported- Import status (0 or 1)payment_method- Payment providershipped- Ship status (0 or 1)
GET /wp-json/gsm-middleware/v1/orders/{id}
- Fetches single order with line items and addresses
- Requires order ID
React Component
File: assets/js/components/OrdersViewer.jsx
Features:
- WordPress Components (@wordpress/components)
- Hooks-based state management
- Loading overlays during data fetch
- Optimized re-rendering
Database Tables
Primary: rm_order
- Stores all order data
- Indexed on
dateadded,ship_status,site
Related:
rm_sites- Site information (LEFT JOIN)rm_lineitems- Order line itemsrm_address- Billing and shipping addressesrm_items- Product SKU lookup
Related Documentation
- Items Page - Inventory viewing
- Database Schema - Table structure
- Orders Page Queries - Query breakdown
- Query Logging - Debug logging
- Performance Optimization - Speed improvements