Test Order
Test and troubleshoot individual order imports using the Test Order tool.
Overview
The Test Order feature allows you to:
- Import a single order on-demand
- See step-by-step sync process
- Diagnose SKU verification issues
- Test kit expansion
- Debug order normalization
- Verify BC export readiness
Location: WordPress Admin → GSM Middleware → Test Order
When to Use Test Order
Common Use Cases
Troubleshooting Failed Orders:
- Order stuck in "rm_error_orders"
- SKU verification failure
- Unknown import error
Testing New Configurations:
- New site setup
- Kit definitions changed
- Shipping method mapping
- Payment gateway changes
Training & Documentation:
- Show how orders process
- Explain sync pipeline
- Demonstrate error handling
Manual Reprocessing:
- After fixing SKU issues
- After updating order data
- After resolving BC errors
Using Test Order
Step 1: Select Site
- Go to GSM Middleware → Test Order
- Select site from dropdown
- Site must be configured and active
Step 2: Enter Order Number
Format varies by platform:
BigCommerce:
12345
- Numeric order ID
- Find in: Orders → Order Details → Order #
WooCommerce:
BGM-12345
- Order number (may include prefix)
- Find in: WooCommerce → Orders → Order #
Step 3: Run Test
- Click "Test Order Import" button
- Watch progress indicator
- Review results
Step 4: Review Results
Success:
✓ Order imported successfully
Order Number: BGM-12345
Platform Order ID: 12345
Customer: John Doe
Total: $125.50
Line Items: 3
Status: Ready for BC Export
[View Order Details] [Export to BC]
Failure:
✗ Order import failed
Order Number: BGM-12345
Error: Bad SKU - INVALID-SKU-001
Reason: SKU does not exist in Business Central
Status: Blocked (in rm_error_orders)
Suggestions:
1. Add SKU to Business Central
2. Run inventory sync
3. Retry test order import
[View Error Details] [Check SKU Status]
Test Results
Success Indicators
✅ Order fetched from platform
- API connection successful
- Order found
- Order data retrieved
✅ Order normalized
- Data converted to standard format
- Addresses parsed
- Payment methods identified
✅ SKUs verified
- All SKUs exist in Business Central
- No blocked statuses
- All items in middleware database
✅ Kit expansion completed
- Kit parents identified
- Component items added
- Quantities calculated
✅ Order written to database
- rm_order record created
- rm_address records created
- rm_lineitems records created
✅ Platform updated
- Order status changed (BigCommerce)
- Order meta updated (WooCommerce)
Detailed Output
Order Header:
Order Number: BGM-12345
Platform: BigCommerce
Date: 2026-03-17 10:30:00
Customer: John Doe ([email protected])
Shipping: USPS Priority Mail
Payment: Credit Card (Stripe)
Billing Address:
John Doe
123 Main St
Anytown, CA 90210
United States
Phone: (555) 123-4567
Shipping Address:
John Doe
123 Main St
Anytown, CA 90210
United States
Line Items:
Line 1: SKU-ABC-123
Description: Product ABC
Quantity: 2
Unit Price: $50.00
Total: $100.00
Status: ✓ Verified
Line 2: KIT-PARENT-456
Description: Kit Parent
Quantity: 1
Unit Price: $0.00
Type: Kit Parent
Status: ✓ Expanded
Line 3: COMP-A
Description: Component A
Quantity: 2 (1 × 2)
Unit Price: $10.00
Total: $20.00
Parent: KIT-PARENT-456
Type: Kit Child
Status: ✓ Verified
Line 4: COMP-B
Description: Component B
Quantity: 1 (1 × 1)
Unit Price: $5.00
Total: $5.00
Parent: KIT-PARENT-456
Type: Kit Child
Status: ✓ Verified
Line 5: SHIPPING
Description: Shipping Fee
Quantity: 1
Unit Price: $10.00
Total: $10.00
Status: ✓ Synthetic
Line 6: SALES TAX
Description: California Sales Tax
Quantity: 1
Unit Price: $11.25
Total: $11.25
Status: ✓ Synthetic
Grand Total: $156.25
Verification Results:
✓ All SKUs verified in Business Central
✓ No blocked item statuses
✓ All items present in middleware database
SKUs checked:
- SKU-ABC-123: OK (Status: Active)
- KIT-PARENT-456: OK (Status: Active)
- COMP-A: OK (Status: Active)
- COMP-B: OK (Status: Active)
Error Diagnosis
SKU Not Found
Error:
✗ SKU Verification Failed
SKU: INVALID-SKU-001
Reason: Not found in Business Central
Solutions:
-
Add SKU to Business Central:
- Log in to Business Central
- Create item with this SKU
- Save and publish
-
Run inventory sync:
php cron/inventory-sync.php -
Retry test:
- Return to Test Order
- Re-run same order
- Should now succeed
Blocked Status
Error:
✗ SKU Verification Failed
SKU: BLOCKED-SKU-789
Reason: Item status 'BLOCKED' not allowed
Solutions:
-
Check blocked status list:
- Go to Settings
- Review "Blocked Item Statuses"
- Verify if status should be blocked
-
Unblock in Business Central:
- Change item status to 'Active' or allowed status
- Run inventory sync
-
Remove from blocked list (if appropriate):
- Edit Settings
- Remove status from list
- Save
Kit Expansion Error
Error:
✗ Kit Expansion Failed
Parent SKU: KIT-PARENT-456
Reason: No kit definition found
Solutions:
-
Add kit definition:
INSERT INTO rm_kits (site_id, parent_sku, child_sku, quantity)
VALUES (5, 'KIT-PARENT-456', 'COMP-A', 2),
(5, 'KIT-PARENT-456', 'COMP-B', 1); -
Verify kit in database:
SELECT * FROM rm_kits WHERE parent_sku = 'KIT-PARENT-456'; -
Retry test
Order Not Found
Error:
✗ Order Fetch Failed
Order Number: BGM-99999
Reason: Order not found on platform
Solutions:
-
Verify order exists:
- Log in to e-commerce platform
- Search for order number
- Confirm it exists
-
Check order number format:
- BigCommerce: Numeric only (
12345) - WooCommerce: May have prefix (
BGM-12345)
- BigCommerce: Numeric only (
-
Check API scopes:
- Verify API has "Orders: Read" permission
- Test connection in site settings
API Connection Error
Error:
✗ API Connection Failed
Site: Main Store
Reason: 401 Unauthorized
Solutions:
-
Test site connection:
- Go to Control Panel
- Click "Test Connection" for site
- Update credentials if needed
-
Check API credentials:
- Verify client ID/access token (BigCommerce)
- Verify consumer key/secret (WooCommerce)
- Regenerate if necessary
-
Verify API scopes:
- Check required permissions granted
- Update API account settings
Advanced Options
Force Reprocess
Use when:
- Order already in database
- Want to update order data
- Testing after fixes
Enable:
- Check "Force Reprocess" checkbox
- Run test
- Existing order data overwritten
⚠️ Warning: This resets import/verify flags!
Skip BC Export
Use when:
- Only testing order import
- Not ready for BC export
- Testing SKU verification
Enable:
- Check "Skip BC Export" checkbox
- Run test
- Order not marked for export
Verbose Logging
Use when:
- Diagnosing complex issues
- Need detailed step-by-step log
- Troubleshooting with support
Enable:
- Check "Verbose Logging" checkbox
- Run test
- Detailed log displayed
Output example:
[10:30:01] Fetching order from BigCommerce...
[10:30:02] Order retrieved: ID 12345
[10:30:02] Normalizing order data...
[10:30:02] Processing 6 line items...
[10:30:03] Checking for kits...
[10:30:03] Kit found: KIT-PARENT-456
[10:30:03] Expanding kit into components...
[10:30:04] Verifying 5 SKUs...
[10:30:05] All SKUs verified
[10:30:05] Writing to database...
[10:30:06] Order saved: BGM-12345
[10:30:06] Updating platform status...
[10:30:07] Complete
Batch Testing
Test multiple orders at once:
Using Order List
- Click "Batch Test" tab
- Enter order numbers (one per line):
BGM-12345
BGM-12346
BGM-12347 - Click "Test All Orders"
- Review summary:
Tested: 3 orders
Success: 2
Failed: 1
Failed Orders:
- BGM-12347: Bad SKU - INVALID-001
Using Date Range
- Select site
- Enter date range:
- From:
2026-03-01 - To:
2026-03-17
- From:
- Click "Test Orders in Range"
- All orders in range tested
- Results summary displayed
Export Test Results
Download Report
- Complete test
- Click "Export Results"
- CSV file downloads with:
- Order number
- Status (Success/Failed)
- Error message (if failed)
- Line item count
- Total amount
- Timestamp
Share Results
- Click "Copy Results"
- Formatted text copied to clipboard
- Paste into email/ticket
- Includes all relevant details
Best Practices
Testing New Sites
- Test with small order first (1-2 items)
- Test order with kit
- Test order with multiple shipping addresses
- Test order with store credit
- Test failed order scenario
Regular Testing
- Test monthly with random order
- Test after plugin updates
- Test after BC configuration changes
- Test new payment methods
Documentation
- Screenshot successful test results
- Document error patterns
- Create test order library
- Maintain troubleshooting guide
Troubleshooting
Test Times Out
Increase timeout:
- Go to Settings
- Increase "API Timeout"
- Increase "Max Execution Time"
- Save and retry
Memory Errors
Increase memory:
- Edit
wp-config.php:define('WP_MEMORY_LIMIT', '512M'); - Restart web server
- Retry test
Results Not Displaying
Check:
- JavaScript console for errors
- Browser compatibility
- Ad blockers disabled
- Clear browser cache
Next Steps
- BC Export Testing - Test BC export
- Troubleshooting - Common issues
- Monitoring - Monitor operations