---
title: Offline Order Auto-Completion Plugin
type: article
created: '2026-01-16'
updated: '2026-01-16'
source_docs:
- raw/2026-01-16-weekly-call-w-karly-115014639.md
tags:
- woocommerce
- php-plugin
- shipstation
- offline-payments
- order-status
- b2b
layer: 2
client_source: null
industry_context: null
transferable: true
---

# Offline Order Auto-Completion Plugin

## Overview

WooCommerce sets offline payment methods (Check, Direct Bank Transfer, COD, etc.) to **"On Hold"** status by default. ShipStation only syncs orders with **"Completed"** status, which means offline orders never reach ShipStation without manual intervention.

The solution is a lightweight custom PHP plugin that hooks into the WooCommerce thank-you page and automatically transitions offline orders from "On Hold" (or "Pending"/"Processing") to "Completed" at the moment of order submission.

This pattern was first built and deployed for [[clients/doodla-farms/_index|Doodla Farms]] B2B site in January 2026.

---

## The Problem

| Step | What Happens |
|------|-------------|
| Customer checks out with offline payment | WooCommerce sets order status → **On Hold** |
| ShipStation polls for new orders | Only picks up **Completed** orders |
| Result | Offline orders are invisible to ShipStation |

Without intervention, Lucy (or any operator) would need to manually open each order in WooCommerce and change the status before ShipStation would see it — an unacceptable workflow at any order volume.

---

## The Solution

A custom plugin hooks into the WooCommerce `woocommerce_thankyou` action (the thank-you page load, immediately after order submission). If the order's payment method is any of the configured offline types, the plugin changes the order status to **Completed** and logs a note.

### Covered Payment Methods

- `cheque` — Check Payments
- `bacs` — Direct Bank Transfer
- `cod` — Cash on Delivery

Additional payment method IDs can be added to the array as needed.

### What the Plugin Does

1. Fires on the thank-you page after order placement
2. Retrieves the order object
3. Checks if `payment_method` is in the offline methods list
4. If yes: calls `$order->update_status('completed', 'Auto-completed by offline orders plugin — [payment method] payment')`
5. The status change triggers ShipStation's sync on its next poll cycle

### Verification

After activation, a test order placed with Check Payments showed the following in WooCommerce order notes:

> Order status changed from **pending payment** to **on hold**  
> Order status changed from **on hold** to **completed** — Auto-completed offline orders plugin, check payment

The order appeared in ShipStation on the next sync cycle (typically within a few minutes).

---

## Deployment

The plugin was created as a standalone folder/file (not added to the theme's `functions.php`) and installed via **Plugins → Add New → Upload Plugin** in the WordPress admin. This keeps it isolated from theme updates and easy to deactivate or modify independently.

**Plugin folder name:** `autocomplete-offline-orders`  
**Activation:** Standard WordPress plugin activation

---

## Important Caveats

- **This marks orders "Completed" before payment is received.** For offline payment workflows, this is intentional — the business collects payment on delivery or via check. The WooCommerce order record is used for fulfillment tracking, not payment confirmation.
- **Invoicing is a separate concern.** Auto-completing the order does not generate or send an invoice. See [[knowledge/woocommerce/woocommerce-quickbooks-invoicing|WooCommerce–QuickBooks Invoicing]] for the companion solution.
- **ShipStation sync is not instant.** ShipStation polls on a schedule (typically every few minutes). A completed order will appear on the next poll, not immediately.

---

## Related Articles

- [[knowledge/woocommerce/woocommerce-quickbooks-invoicing|WooCommerce–QuickBooks Invoicing]] — Generating invoices for offline orders
- [[knowledge/woocommerce/b2b-checkout-customization|B2B Checkout Customization]] — Company name field, PO field, and other B2B checkout fixes
- [[clients/doodla-farms/_index|Doodla Farms]] — Client where this was first deployed