Sync your supplier’s stock to WooCommerce

Syncing your supplier's stock on WooCommerce

If your supplier publishes its stock in a CSV or XML file, the WP All Import plugin can read that file every day and update the stock of your WooCommerce products, with no data entry at all. Products are matched by their reference (SKU), and only the stock is changed. Here is the method.

In short

  • You need your supplier’s file, at an address that does not change.
  • Tools: WP All Import and its WooCommerce add-on, in the Pro version for importing from a URL and scheduling.
  • The key to it all: the same reference (SKU) on your side and your supplier’s.
  • Only the stock fields are updated, so your texts and prices are never overwritten.
  • Always test on a copy of the site before scheduling.

The same principle takes you further: updating prices, descriptions and images, or creating the supplier’s new products automatically. Here we focus on the most requested case: stock.

The 4 steps: the supplier's file, the scheduled import, matching by SKU reference, then the stock update

What you need

  • Your supplier’s file, in CSV or XML, available at a fixed address (a link that always gives the latest version).
  • Matching references: the reference of each product in WooCommerce (the SKU field) must be the one in the file.
  • WP All Import and its WooCommerce add-on. A free version exists, but importing from a URL and automatically repeated imports are part of the Pro version.
  • Administrator access to your site, and a test copy if possible.

Step 1: create the import

  1. In the admin, open All Import > New Import.
  2. Choose Download from URL and paste the address of your supplier’s file. Depending on the number of products, the download may take a while.
  3. Choose to update existing items (Existing Items) of the WooCommerce Products type.

Step 2: find the products in the file

WP All Import shows the content of the file. Select the element that matches a product (often called article, product or item, depending on your supplier). You then see, product by product, the reference and the quantity in stock.

Step 3: map the fields

In the WooCommerce part of the screen:

  • drag the reference from the file into the SKU field;
  • under Inventory, turn on stock management (Manage stock) and drag the quantity from the file into Stock Qty.

Leave everything else alone.

Step 4: say how to match the products

WP All Import needs to know which product in your shop matches which line of the file. Choose matching by custom field, on the reference: WooCommerce’s _sku field, compared with the reference in the file.

Step 5: update the stock only

This is the most important step. Choose to update existing products with the changed data from the file, then untick everything except the stock fields. In practice, only the quantity, stock management and stock status (in stock or out of stock) should be able to change.

That way, a product goes out of stock automatically when your supplier runs out, and comes back in stock when it is restocked. Your titles, descriptions, prices and images stay as they are.

WP All Import can also set products that have disappeared from the file to out of stock, rather than deleting them. Handy when a supplier drops a reference.

Step 6: run, check, schedule

  1. Run the import once and check a few products by hand.
  2. Then schedule the import, for example every night, with WP All Import’s scheduling or a cron job on your hosting.
  3. Read the import log for the first few days: a supplier file that changes format can block everything.

Good to know: WooCommerce’s HPOS order storage changes nothing here. It concerns orders, not products.

And without a file?

Some suppliers do not publish a file but offer an API. Others send a spreadsheet by e-mail. In these cases, a connector built for your supplier is often more reliable than a generic import. Already managing your data in a spreadsheet? Read our article on syncing with Google Sheets too.

Save time on your stock

Setting up the import, configuring the schedule, or a custom connector for your supplier’s API: we can take care of it.

Discover our custom plugins or hand your sync over to us

Contents
Read next

More articles that may help you

Illustration au trait : un casque audio, une onde sonore, un stockage de fichiers et le symbole d’un flux RSS

Self-hosted podcast: moving a podcast to WordPress and Cloudflare R2

Read the article →
Illustration au trait : une patinoire vue de dessus, des sapins et un écran d’état avec deux pastilles

Ice rink and skating trail: a municipality’s custom WordPress plugin

Read the article →
WooCommerce e-invoicing: how to make your shop compliant

WooCommerce e-invoicing: how to bring your shop into compliance

Read the article →

A project, a question?

Free quote · Refundable deposit · Balance only if satisfied · No commitment