How to Sync Inventory and Prices Between WooCommerce Stores
Since I created the Inventory Sync for WooCommerce plugin, I keep receiving requests from customers who’d like to also sync product prices along with the stock information.
Is it possible to sync prices together with product stock? Sure, it is.
Below, I will show you two methods of how we can achieve that – with the help of the mentioned plugin or custom coding.
Now, let’s dive into it.
Method 1. Using Inventory Sync for WooCommerce Plugin
When adding the functionality of syncing product prices together with product stock information, I was facing a dilemma:
- I didn’t want to include a checkbox “Sync Product Prices” inside the plugin settings, because, in my opinion, it doesn’t look suitable there; after all, the plugin is intended only for stock synchronisation (stock status, quantity, and the “Manage Stock” checkbox).
- Asking customers to purchase another plugin for full product synchronization (I mean either my Simple WP Crossposting or Simple Multisite Crossposting plugins) feels like an overkill for such a small task as price synchronization.
So, what is a solution here?
Using a filter hook, of course.
In the end, I’ve included a very nice and convenient filter hook – rudr_invsync_product_data (or rudr_wpmu_invsync_product_data – for WooCommerce Multisite), which allows you to add prices to the synchronization. You can find it described in the plugin documentation.
Now, let’s jump into the step-by-step guide.
Step 1. Connect target stores
As usual, the first step after you have the Inventory Sync for WooCommerce plugin installed and activated is to connect target stores, which will receive updated stock (and prices) in the plugin settings.

Normally, we use REST API credentials to connect stores; however, if your store is within the same WooCommerce Multisite network, then you can just select it from the dropdown list.
You can read more about connecting stores here.
Step 2. Include regular price and (or) sale price to the synchronization
Let’s start with an example for non-multisite (standalone) WooCommerce stores:
add_filter( 'rudr_invsync_product_data', 'rudr_include_prices_1', 25, 3 );
function rudr_include_prices_1( $product_data, $product, $store ) {
$product_data[ 'regular_price' ] = $product->get_regular_price();
$product_data[ 'sale_price' ] = $product->get_sale_price();
return $product_data;
}The situation for WooCommerce Multisite is very similar, by the way. So, let’s make our code a little bit more interesting – let’s sync our product prices only when we perform the stock synchronization to a specific store, let’s say, it will be a store with ID = 5.
add_filter( 'rudr_wpmu_invsync_product_data', 'rudr_include_prices_2', 25, 3 );
function rudr_include_prices_2( $product_data, $product, $store_id ) {
if( 5 === $store_id ) {
$product_data[ 'regular_price' ] = $product->get_regular_price();
$product_data[ 'sale_price' ] = $product->get_sale_price();
}
return $product_data;
}If you don’t know how to use code snippets, read this guide.
Method 2. Programmatically
There are already plenty of tutorials on my blog about syncing product stock between stores programmatically, so I am not going to start everything from scratch again.
I will provide references to original tutorials and some adjustments to the examples we will get from there, so we can also sync prices with the product stock information.
Option 1. For Standalone WooCommerce stores
First things first, let’s start with an example of syncing stock between standalone stores. In order to achieve that goal, we will need to use the WooCommerce REST API. The code customization to include prices is quite simple, though; all we need to do is slightly modify the request body inside the rudr_sync_product_stock_another_store() function from the example:
$woocommerce->put(
'products/' . $remote_product->id,
array(
'manage_stock' => $product->get_manage_stock(),
'stock_quantity' => $product->get_stock_quantity(),
'stock_status' => $product->get_stock_status(),
// here we go!
'regular_price' => $product->get_regular_price(), // that's it!
)
);Option 2. For stores within the same WordPress Multisite network
Now, let’s talk about a WordPress (or WooCommerce) multisite installation. The example we are going to use here is from the central stock tutorial.
So, let’s go ahead and modify the rudr_sync_central_stock() function.
First, we need to get the initial product price at the beginning of the function:
function rudr_sync_central_stock( $product ) {
// get the updated product inventory data
$stock_status = $product->get_stock_status();
$stock_qty = $product->get_stock_quantity();
$price = $product->get_regular_price() // doing it hereSecond, sync the price together with both stock status and quantity:
if( $product2 ) {
$product2->set_stock_status( $stock_status );
$product2->set_stock_quantity( $stock_qty );
// here we go!
$product2->set_regular_price( $price );
$product2->save();
}That’s pretty much it, guys. It is up to you to decide whether you’d like to use a plugin approach or a programmatic one. In any way, if you have any questions, feel free to ask in the comments section below.
Misha Rudrastyh
Hey guys and welcome to my website. For more than 15 years I've been doing my best to share with you some superb WordPress guides and tips for free.
Need some developer help? Contact me