Skip to main content

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:

ColumnDescription
SiteStore name (e.g., "Site 1 - Main Store")
Order NumberOrder number from e-commerce platform
Nav OrderNAV sales order number (if imported)
PaymentPayment provider (Klarna, Stripe, etc.)
StatusBadge showing Pending/Imported/Verified
Date AddedWhen order was created
Ship StatusShipped or Not Shipped
Ship AgentShipping carrier code (e.g., FEDEX, UPS)
ActionsView 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:

ColumnDescription
SKUProduct SKU
QuantityNumber of units ordered
PriceUnit price
TotalLine 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
  • Email

Shipping Address:

  • Name
  • Address lines
  • City, State, ZIP
  • Country
  • Phone

Common Workflows

Finding a Specific Order

By Order Number:

  1. Enter order number in search field
  2. Press Enter or click Search
  3. Order appears in results

By Site:

  1. Select site from Site dropdown
  2. Orders filtered to that site only

By Status:

  1. Select status from Status filter
  2. View only orders in that import state

Checking Shipped Orders

  1. Set Shipped filter to "Shipped"
  2. View all orders that have been fulfilled
  3. Combined with other filters for specific queries

Payment Method Reports

  1. Select payment method from filter
  2. View all orders using that payment processor
  3. Useful for reconciliation and reporting

Viewing Order History

  1. Use pagination to browse through order history
  2. Orders sorted by date added (newest first)
  3. 20 orders per page for optimal performance

Performance Notes

The Orders page is optimized for fast loading:

  • Database Indexes - Critical indexes on dateadded and ship_status columns
  • 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:

  1. Sites Query (1 query)

    SELECT * FROM rm_sites WHERE is_active = 1 ORDER BY name ASC
  2. Orders COUNT (1 query)

    SELECT COUNT(*) FROM rm_order WHERE [filters]
  3. 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:

  1. Apply migration 011 to add performance indexes
  2. Verify indexes exist: SHOW INDEX FROM rm_order
  3. Check debug.log for slow queries
  4. 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 term
    • site - Site ID filter
    • imported - Import status (0 or 1)
    • payment_method - Payment provider
    • shipped - 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 items
  • rm_address - Billing and shipping addresses
  • rm_items - Product SKU lookup