How The Product Stock Sync Works

The plugin automatically syncs the following inventory fields: “Stock Management”, “Stock Status”, and “Quantity”. You can also exclude some of these fields or add new ones.

WooCommerce product inventory fields

With this plugin, the inventory synchronization between connected WooCommerce stores happens automatically, in the background:

  • A customer purchased a product, and its stock quantity was decreased.
  • An order was refunded, and stock quantities of all related products were restored.

The product inventory can also be synced manually:

  • When a product’s or variation’s “Stock Status” or “Quantity” fields have been changed via the WooCommerce interface, for example, by a shop manager.
  • When using the full synchronization tool to force re-sync stock statuses and stock quantities of all existing products with a selected store.

The plugin can use SKU, product slug, or “GTIN, UPC, EAN, or ISBN” as a sync entity (meaning that it will be used to find similar products and variations across connected stores), which can be configured in the plugin settings.

If you need to sync other product data like images, prices, or custom fields, take a look at the Simple WordPress Crossposting plugin.

1. Connect a store to sync the product stock with

To start the WooCommerce inventory sync, you need to connect stores first.

In the “WooCommerce > Settings > Products > Inventory Sync” page, scroll down a little:

add a store to sync product inventory with

The process of adding a new store becomes much easier if your stores are part of a single WordPress Multisite network.

Connect a store to sync stock in WordPress Multisite
If your store is a part of a WordPress Multisite network, you don’t have to provide any credentials; just select the store you need from the dropdown list. You can also connect a standalone store to any store in your network.

You don’t need to install the plugin on connected stores unless you need the WooCommerce inventory sync to work both ways. But when using a plugin within a single WordPress multisite network, it should be network-activated.

2. Configure plugin settings (optional)

The settings are available in “WooCommerce > Settings > Products > Inventory Sync”.

Inventory Sync for WooCommerce plugin settings

The plugin comes with the following global synchronization options:

  • Sync method – allows you to choose whether you want the plugin to process synchronization instantly or asynchronously, in the background (Action Scheduler is the standard WooCommerce method of handling background tasks, by the way).
  • Cascade sync – this option is helpful for complex store networks.
  • Product connection type – here you can choose between SKU, “GTIN, UPC, EAN, or ISBN”, or product slug.

More in-depth configuration is available via hooks, which can be found in the documentation.

3. Exclude specific products and variations from the sync (optional)

You can easily exclude products whose product stock you don’t want to be synced with connected stores in the product settings.

exclude specific products from stock synchronization
All you need to do is visit a specific product edit page in the admin dashboard, then switch to the “Inventory” tab in the Product data meta box and check the checkbox there.

It is also possible to exclude not the whole product but only some specific variations from the stock sync:

Exclude specific product variation from the stock sync
When editing a specific variation, you can decide whether it should or shouldn’t be excluded from the stock synchronization.

4. Start initial stock synchronization

As mentioned, the WooCommerce product inventory is synced automatically when an order is made or a product is updated.

But you can also use a tool, which is part of this plugin, to run a full product stock resync in the background; find it in WooCommerce > Status > Tools. For example, if you just installed the plugin and want to run an initial synchronization of the stock quantities of all products from “Store A” to “Store B”.

Tool which allows to run full product stock resync in the background
You can push stock quantities from the current store’s inventory to any connected store’s inventory.

How to Configure Central Stock for WooCommerce Stores

You can also use this stock sync plugin when you need to manage the inventory of multiple WooCommerce stores in one place.

However, for the sake of simplicity, the plugin doesn’t create any extra admin pages; you just need to choose a store that will serve the purpose of the central stock. It can be any sub-store of a WooCommerce multisite network as well.

Take a look at the table below to get a clear picture of the configuration steps:

The central stock storeSub-stores
Install the plugin and connect all the sub-stores in the plugin settings.Install the plugin and connect the master store (with the central stock) in every sub-store’s settings page.

That’s pretty much all the configuration we need here.

Using WooCommerce logs

When you have a lot of products in your stores and/or a lot of connected stores, then it is always good to keep track of what’s exactly happening under the hood. This can be easily done with the logs.

My plugin uses the standard WooCommerce logs functionality, which means that you can find the inventory sync logs in WooCommerce > Status > Logs:

Logging the changes in inventory levels across WooCommerce stores
If “Product connection type” is set to “SKU”, then variations should also have their unique SKUs; it is exactly what the notice says in this debug log.

Sync Stock Levels Using a WP-CLI Command

The plugin comes with a handy WP-CLI command wp isfw stock-sync that allows you to synchronize stock levels easily (if you know what it is and how to use it).

It can be especially useful for the initial synchronization.

For example, let’s say you want to sync stock levels for all products between the current store and a specific target store:

$ wp isfw stock-sync --store=rudrastyh.com

There are a bunch of other parameters as well:

ArgumentDescription
[--id=<product-ID>]You can provide a specific product ID here. If not provided, the plugin will try to run the sync for all published products.
[--blog_id=<blog-ID>]When working with a WordPress multisite network, using this parameter, you can provide a specific sub-store ID.
[--store=<store-URL>]You can provide a target store URL here (it works for both sub-sites of a multisite network and standalone stores), but please make sure that the store is added in the plugin settings.