Overview
By default, WooCommerce couples inventory reduction to order creation and payment completion. For stores with manual payment verification, Net-30 invoicing, warehouse staging, dropshipping, or custom fulfillment steps, this default behavior can reduce inventory prematurely or restore it incorrectly.
WooCommerce Stock by Order Status intercepts WooCommerce's internal stock triggers and gives store owners two explicit lists:
- Reduce Stock Statuses: Order statuses that should decrement inventory.
- Restore Stock Statuses: Order statuses that should return inventory back to available stock.
System Requirements
| Requirement | Supported Version |
|---|---|
| WordPress | 6.0 or higher |
| WooCommerce | 7.0 or higher (Tested up to 11.0.1) |
| PHP | 8.1 or higher |
| Order Storage | HPOS (Custom Order Tables) & Classic Post Storage |
Installation
- Download the plugin ZIP file from your ThemeFoucs account.
- Log in to your WordPress dashboard and navigate to Plugins → Add New → Upload Plugin.
- Select the
woocommerce-stock-by-status.zipfile and click Install Now. - Click Activate Plugin.
Need an active license key? Purchase a Single-Site License for $39/year →
Configuration
Once activated, navigate to:
WooCommerce → Settings → Products → Stock Rules
You will find two multi-select status lists:
- Reduce Stock on: Select the statuses that consume inventory (Default:
Processing,Completed). - Restore Stock on: Select the statuses that restock inventory (Default:
Cancelled).
Click Save changes to apply your rules.
The plugin includes built-in conflict prevention. A single status cannot be selected in both the reduction list and the restoration list simultaneously. If selected, the settings sanitizer will resolve the conflict and alert you.
Stock Reduction Rules
When an order transitions to a status in your reduction list:
- The plugin checks whether the order has already been reduced via the order flag
_order_stock_reduced. - If unreduced, it executes WooCommerce's native
wc_maybe_reduce_stock_levels(). - Each line item's
_reduced_stockmetadata is recorded, tracking exact quantities deducted. - If the order was already reduced, the transition is strictly idempotent—no duplicate deduction occurs.
Stock Restoration Rules
When an order transitions to a status in your restoration list (such as Cancelled):
- The plugin checks if the order was ever reduced. If an unpaid order on hold was cancelled without ever reducing stock, no restoration occurs, preventing ghost inventory.
- If the order was reduced, it restores exactly the remaining non-refunded line item quantities and clears the reduction flag.
Custom Order Statuses
Any custom order status registered on your site via custom code, ERP integrations, or plugins (e.g. "Preparing Shipment", "Packaging", "Awaiting Invoice") is dynamically retrieved via wc_get_order_statuses() and appears in both settings lists.
High-Performance Order Storage (HPOS)
The plugin declares official compatibility with HPOS:
FeaturesUtil::declare_compatibility(
'custom_order_tables',
__FILE__,
true
);
All stock reduced flags and line item metadata are accessed through native WooCommerce CRUD methods ($order->get_data(), $order->save()), ensuring zero compatibility issues regardless of whether your store uses custom order tables or legacy postmeta.
Refund Handling
When processing full or partial refunds through WooCommerce:
- If the "Restock refunded items" box is checked in WooCommerce, core updates the line item's
_reduced_stockquantity. - If the entire order is subsequently cancelled, the plugin restores only the remaining unrefunded units, ensuring physical inventory counts remain accurate.
Variable Products
The plugin supports:
- Simple products.
- Variable products where each individual variation manages its own stock.
- Variable products where variations manage inventory at the parent product level.
Troubleshooting
Stock is not reducing on my custom status:
Ensure the custom status slug is checked under WooCommerce → Settings → Products → Stock Rules and that the order has not already had stock reduced by an earlier transition.
Payment gateway reduces stock immediately:
Some payment gateways call $order->payment_complete() which fires core stock hooks. Our plugin filters woocommerce_payment_complete_reduce_stock to ensure payment completion respects your configured status rules.
Frequently Asked Questions
Does this plugin modify my database tables?
No. The plugin creates zero custom database tables. It stores two standard settings in the wp_options table and uses native WooCommerce order metadata.
What happens if I deactivate the plugin?
WooCommerce reverts to its native stock transition behavior. No order data or product inventory counts are deleted or altered.
Support & Help
Need assistance or encountered an edge-case with a custom payment gateway?
Commercial license holders can reach our technical support team at: support@themefoucs.co