Now is your last chance to buy a lifetime license before we switch to annual pricing. Existing licenses will be unaffected.
read more
Posted on December 10, 2023

How to Update Stock in WooCommerce

hello world!

A fairly common task with WooCommerce products is updating stock levels. This may occur because of an inventory count, a lack of automated inventory control, or because the stock levels are maintained by a third party, as happens with drop shipping.

Whatever the cause, manually updating stock levels can be very time-consuming. In this article, we show you how to automate this task using WP All Import.

Table of Contents

Typical Scenarios When Updating Stock in WooCommerce

There are three typical scenarios when updating stock in WooCommece:

  1. You have a set of products already defined in WooCommerce, but the stock is maintained by a third party, and that third party sends you a product file that you haven't imported before. This file contains stock data.
  2. A third party sends you a product file that you have imported before, and it contains updated stock data.
  3. You want to edit the product stock levels in your store more efficiently than using the WooCommerce interface.

We show you how to address each of these scenarios below.

Updating Stock in WooCommerce Using a New Import File

In this scenario, a third party has sent you a file that you haven't imported before (i.e., the file structure is new), and that file contains stock levels for products that you created or imported previously. You want to apply the new stock levels to your existing products.

Step 1: Create a New Import for WooCommerce Products

Navigate to All Import › New Import, load the product file, choose Existing Items, and select WooCommerce Products as the import type.

Update Stock WooCommerce - New Product Import

Step 2: Review the Product Import File

This screen lets you check the structure and content of the import file. As you can see below, the file is very simple, containing only a few key product fields along with the stock field.

Update Stock WooCommerce - Review Import File

Step 3: Map Incoming Stock Level Data to the Stock Qty Field

Map the incoming stock data element to the Stock Qty field in the Inventory tab of the WooCoommerce Add-On section of the Drag & Drop screen:

Update Stock WooCommerce - Map Data Elements to Fields

Click the Continue to Step 4 button at the bottom (not shown).

Step 4: Match Existing Products and Update the Stock Qty Field Only

In the Import Settings screen:

  1. Choose Custom Field in the section titled Records in this import file will be matched with Products on your site based on...
  2. Drag and drop the sku data element to the Value field.
  3. Select the Choose which data to update option in the section titled For each record in this import file, every time this import is run...
Update Stock WooCommerce - Import Settings

In other words, you're matching the incoming data to your existing products based on SKU, and you're only going to update specific fields, which you get to specify further down the screen:

Update Stock WooCommerce - Import Settings 2

Click Continue at the bottom of the screen (not shown).

Step 5: Finish the Update

Click the Confirm & Run Import on the next screen. When the import completes, your WooCommerce stock levels should be updated as expected.

Update Stock WooCommerce - Confirm and Run

Updating Stock in WooCommerce Using an Updated Import File

In this scenario, the third party has sent you a new version of a file that you have imported previously.

Because WP All Import records all the settings used for import, all you have to do in this situation is go to All Import › Manage Imports and click the Run Import button for the import that you ran previously.

Update Stock WooCommerce - Manage Imports

This will automatically apply the updated stock levels to the affected products.

Updating Stock in WooCommerce Through Bulk Edits

In this scenario, you need to manually edit the existing stock levels in your WooCommerce store. Doing so through the WooCommerce interface can be tedious, so WP All Import gives you the opportunity to edit the data in a spreadsheet instead.

Step 1: Export the Products You Want to Edit

Navigate to All Export › New Export and create a new product export:

Update Stock WooCommerce - New Export

In Action 3 above, you can see that we created a filter to limit the export to simple products only. For more information on filters, see Filtering Import Data with XPath.

After you click the Customize Export File button, you'll be brought to the Drag & Drop interface. Here, you simply drag and drop your export columns from the available fields on the right into the column selection area on the left. In this case, make sure you drag and drop the Stock field:

Update Stock WooCommerce - Drag & Drop Export

Click the Continue button, followed by the Confirm & Run Export button on the next screen. When the export completes, you'll see this screen:

Update Stock WooCommerce - Confirm and Run Export

To download your export file, click the blue CSV button.

Step 2: Change the Stock Levels in a Spreadsheet

Open the product CSV file in your favorite spreadsheet and use copy-and-paste, search-and-replace, and formulas to make large-scale changes to your stock quantity data.

Save your changes.

Step 3: Reimport the Updated Stock Levels

Go to All Export › Manage Exports and locate your recent export. To import your changed file, simply click the Import with WP All Import option on the right:

Update Stock WooCommerce - Manage Exports

This will create a new import:

Update Stock WooCommerce - Reimport Updated File

Upload your changed file, then click Continue to Step 2. This will bring you to the Drag & Drop screen. If you look at the relevant fields, you will see that WP All Import has used the information from the export to automatically map the correct fields:

Update Stock WooCommerce - Automatic Mapping for Reimport

It also knows which fields to update:

Update Stock WooCommerce - Automatic Mapping for Reimport 2

To apply your changes, just complete the import.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get Oxygen Today

Lifetime, unlimited site license

Copyright © 2024 Soflyy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram