How to manage stock and backorders in WooCommerce

Last Updated on: 7th February 2024, 08:58 pm

WooCommerce allows to manage inventory for each product and product variations. Enable the “Manage Stock?” option to make the following visible:

Screenshot of the inventory tab of a WooCommerce Simple product.

Stock control

Stock Control Plugin Stock Control Plugin
I created a plugin to help with stock management. Stock Control allows you to bulk edit all stock related data of your products. It also logs all changes made to stock related data. This plugin aims to be your swiss army knife for all stock related data of WooCommerce. Feature requests via the plugin page forum are welcome.

WooCommerce has two options used to manage stock.

  • The stock quantity which counts the number of available items.
  • The stock status which manages the availability of the product on the front end.

In the default configuration backorders are not allowed. This ensues the following behaviour:

  • Setting the stock quantity to zero or having it fall to zero due to a sale automatically sets the stock status to “Out of stock”. This is then reflected in your front end like so:

Screen Shot

backorders = do not allow
stock quantity = 0
stock status automatically set to “out of stock” due to stock quantity below 1

This is how most stores handles this. Now lets add the backorder option to the configuration and play through all three possible options.

Variable products

Contrary to simple products the standard inventory tab is not used. This means that despite active stock control your inventory tab for your variable product will have:

  • “Manage stock?” unchecked
  • No stock quantity
  • No SKU
  • No relevant Stock status

No need to be alarmed by this. Instead these are now located with each product variation:

Managing backorders

As long as backorders are set to “Do not allow”, the following is true: 

  • The product cannot be ordered from the front end.
  • The stock quantity can be set to negative number, for example “-3” via the product edit screen in the backend.
  • An order added manually via the WooCommerce backend will not decrease the stock further automatically. Instead you need to edit the order and manually decrease the stock by clicking on the line item and then use the “Reduce stock” button:

Screen Shot

  • Reducing stock manually via “Reduce Stock” will set the stock below zero to negative values. For example from -2 to -3. Stock changes are normally recorded in the order notes. Reducing the stock like this with these options does not record the action in the order notes.

If you want to keep accepting orders and have your customers pay for them in advance, you need to allow backorders.

Setting the backorders option to “Allow, but notify customer” changes the scenario. Now the following is true: 

  • Changing the stock value in the backend now does not set the stock status. Because WooCommerce is now prepared to keep selling regardless of the inventory count, both values are not linked any longer.
  • The product can be purchased from the front end. There is a notice above the add to cart button that signals that this is a backorder:

Screen Shot

backorders =Allow, but notify customer
stock quantity = 0
stock status = in stock

  • Backorders only are possible for as long as the stock status is “in stock”. Setting the product to out of stock will again block purchases and display “out of stock”.
  • Customers can purchase the product and checkout as normal. They pay in full and every purchase will decrease the stock. The order will indicate that it is a backorder in the cart and checkout.

Screen Shot

Thank you page indicating the backorder status.

  • Viewing the order in the backend will provide similar information:

Screen Shot

  • Stock reductions are also recorded in the order notes:

Screen Shot

Setting the backorders option to “Allow” produces the same scenario without the backorder labels.

The product is basically shown and treated as “in stock”.  But the stock can be negative. However your customers get no signal that they are ordering on backorder.

The above mentioned plugin will still correctly count all backorders since WooCommerce adds a meta information to the order that flags it as a backorder.

The only difference here is that this information is output nowhere. It allows for “invisible” / discreet backorder function.

How to show a notice for when WooCommerce backorders are allowed

Here is a code snippet that allows you to add notices for when backorders are (not) allowed:

Here is how to handle these kind of code snippets.

Third party applications

The relationship described above where stock quantity triggers stock status and backorders define their behaviour only works properly when the WordPress backend is used to do so, or if a purchase is made.

Keep in mind that values such as stock quantity, stock status and backorders can also be managed by third party applications via API calls and / or CLI commands. In which case the hooks that link stock quantity and stock status and other checks are bypassed.

This means a third party application (such as your fulfillments company) can possibly set a product to wonky configurations that are normally automatically checked and corrected by WooCommerce.

For example:
stock quantity = 0
stock status = in stock.
backorders = Do not allow

If you run into inconsistent stock behaviour then chances are that external commands only pass a value for stock quantity while neglecting to pass the stock status as well. Oftentimes the backorder values are completely ignored.

It is good practice to account for all three values whenever such a command is sent to WooCommerce. Check with your third party and ensure that the code that manages your WooCommerce stock does account for all three options so that wonky configurations do not come to pass.

 

Image credits: Header image doodle by Anna Werner for wp4e.de

8 responses

  1. […] Must Read Article: How to manage stock and backorders in WooCommerce […]

  2. Thank you for this, I needed a little clarification and this article did the trick.

    I am wondering if someone would know… I am looking for a plugin, that would allow only certain payment methods when there are products on backorder in the cart. For example when someone orders two things, one in stock and one on backorder, I want them to be able to pay only with card or bank wire, no cash on delivery. When someone orders only stock products, they could also choose COD. Any idea would be highly apreciated.

    1. Con Schneider Avatar
      Con Schneider

      Hi Lukas,

      Glad to hear the article was helpful.

      > I am looking for a plugin, that would allow only certain payment methods when there are products on backorder in the cart.

      I have not come across a plugin that can do this, but I would probably start with a plugin that can manage conditional payment gateways and try to expand this with a stock status check. Here is a stack overflow entry about a snippet that checks for product stock status in the cart.

      1. Hi Con,

        is it possible limit “available” stock level for the product with allowed back-order status?
        Let’s say the shop is waiting for delivery for two shirts and they would like to accept back-order for these two shirts only.

        1. Con Schneider Avatar
          Con Schneider

          Hello Peter,

          Thanks for your comment and clear example.
          WooCommerce has no built in feature for this. This will require custom code to be written.

  3. All my products (simple and variable) are set to ‘do not allow backorders’.
    Despite this, I am still getting orders with backorders in them! :/ I can’t find out why…

    1. Con Schneider Avatar
      Con Schneider

      Hey mimi,

      You could try whether the code snippet here allows you to set a message. This would tell you whether the backorder status is present and loaded as a first step.

      Kind regards,

    2. Is your store integrated with external service, which updates your stock by any chance? Some external ERP/Warehouse/Inventory management service via a Plugin or Woocommer API maybe updating your stock outside of woocommerce and it maybe causing issue. I am right now investigating a similar scenario for one of my client’s website.

Leave a Reply

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

Con Schneider