Skip to main content

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

  1. Go to GSM Middleware → Test Order
  2. Select site from dropdown
  3. 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

  1. Click "Test Order Import" button
  2. Watch progress indicator
  3. 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:

  1. Add SKU to Business Central:

    • Log in to Business Central
    • Create item with this SKU
    • Save and publish
  2. Run inventory sync:

    php cron/inventory-sync.php
  3. 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:

  1. Check blocked status list:

    • Go to Settings
    • Review "Blocked Item Statuses"
    • Verify if status should be blocked
  2. Unblock in Business Central:

    • Change item status to 'Active' or allowed status
    • Run inventory sync
  3. 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:

  1. 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);
  2. Verify kit in database:

    SELECT * FROM rm_kits WHERE parent_sku = 'KIT-PARENT-456';
  3. Retry test

Order Not Found

Error:

✗ Order Fetch Failed
Order Number: BGM-99999
Reason: Order not found on platform

Solutions:

  1. Verify order exists:

    • Log in to e-commerce platform
    • Search for order number
    • Confirm it exists
  2. Check order number format:

    • BigCommerce: Numeric only (12345)
    • WooCommerce: May have prefix (BGM-12345)
  3. 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:

  1. Test site connection:

    • Go to Control Panel
    • Click "Test Connection" for site
    • Update credentials if needed
  2. Check API credentials:

    • Verify client ID/access token (BigCommerce)
    • Verify consumer key/secret (WooCommerce)
    • Regenerate if necessary
  3. 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:

  1. Check "Force Reprocess" checkbox
  2. Run test
  3. 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:

  1. Check "Skip BC Export" checkbox
  2. Run test
  3. Order not marked for export

Verbose Logging

Use when:

  • Diagnosing complex issues
  • Need detailed step-by-step log
  • Troubleshooting with support

Enable:

  1. Check "Verbose Logging" checkbox
  2. Run test
  3. 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

  1. Click "Batch Test" tab
  2. Enter order numbers (one per line):
    BGM-12345
    BGM-12346
    BGM-12347
  3. Click "Test All Orders"
  4. Review summary:
    Tested: 3 orders
    Success: 2
    Failed: 1

    Failed Orders:
    - BGM-12347: Bad SKU - INVALID-001

Using Date Range

  1. Select site
  2. Enter date range:
    • From: 2026-03-01
    • To: 2026-03-17
  3. Click "Test Orders in Range"
  4. All orders in range tested
  5. Results summary displayed

Export Test Results

Download Report

  1. Complete test
  2. Click "Export Results"
  3. CSV file downloads with:
    • Order number
    • Status (Success/Failed)
    • Error message (if failed)
    • Line item count
    • Total amount
    • Timestamp

Share Results

  1. Click "Copy Results"
  2. Formatted text copied to clipboard
  3. Paste into email/ticket
  4. Includes all relevant details

Best Practices

Testing New Sites

  1. Test with small order first (1-2 items)
  2. Test order with kit
  3. Test order with multiple shipping addresses
  4. Test order with store credit
  5. 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:

  1. Go to Settings
  2. Increase "API Timeout"
  3. Increase "Max Execution Time"
  4. Save and retry

Memory Errors

Increase memory:

  1. Edit wp-config.php:
    define('WP_MEMORY_LIMIT', '512M');
  2. Restart web server
  3. Retry test

Results Not Displaying

Check:

  • JavaScript console for errors
  • Browser compatibility
  • Ad blockers disabled
  • Clear browser cache

Next Steps