Show total stock across WooCommerce variable product variations

Published Updated 2 min read

WooCommerce tracks stock per variation. A jacket in four sizes and three colours has twelve separate stock numbers, and the products list in wp-admin shows only an in-stock or out-of-stock marker. To know how many jackets you have, you open the product, go to the Variations tab and add them up yourself.

A small plugin adds one sortable column to the list, Total Stock. For variable products it sums every variation with stock management on; for simple products it shows the product's own quantity. Sort it to find what is running low before it runs out.

Why the product list does not show a total

Stock lives per variation because a large and an extra-large jacket are managed separately: you can sell out of large and still have medium, so one number would mislead a purchasing decision. The product row shows aggregate status (in stock, out of stock, on backorder) but not the count.

The Variations tab is the right place for per-SKU decisions. What is missing is the figure in between: how many of a product you hold across all sizes and colours, visible without clicking into anything.

A Total Stock column between SKU and Price

For a variable product the column adds up the quantities of every variation with stock management enabled and ignores the rest. A managed variation at zero, or below zero from backorders, counts as it stands, so the total is what is really on hand. A simple product with stock management on shows its own quantity. Where nothing tracks stock, the column shows a dash, because there is no total to report.

Click the header to sort every product by total stock, up or down, and the emptiest shelves come to the top without opening a product page. There is no settings page and no API key; the column is there as soon as the plugin is active.

Clothing, shoes and anything with sizes

Clothing and footwear gain most. A t-shirt in three colours and five sizes is fifteen variation entries, and the column tells you at a glance whether there are two dozen on hand or two. Seasonal restocks, end-of-year counts and decisions to discontinue all depend on that number being visible in the list.

Electronics in several colours, furniture in several sizes, any catalogue with more than a handful of variable products hits the same wall. A total per product is not exotic analytics; it is what a stock room would write on a paper inventory sheet.

Already running ATUM?

If you need purchase orders, supplier records, stock history or forecasting, ATUM Inventory Management covers all of it, total stock view included, and a separate plugin for one column would be redundant. The column reads the standard WooCommerce stock fields that ATUM and most inventory plugins also use, so running both does no harm.

Where the only gap is a total across variations, this is far lighter than a large plugin's worth of tables and admin pages. It reads stock through WooCommerce's own methods, so most stores notice no slowdown; a catalogue with thousands of variable products, each with many variations, may see a small delay on the products page.

What you get

Included

  • Sortable Total Stock column in the WooCommerce Products admin list
  • Correct sum for variable products across all variations with stock management enabled
  • Simple product stock quantity shown when stock management is on
  • Dash displayed for products where no variation tracks stock

Not included

  • Per-variation stock breakdown (WooCommerce shows this on the product Variations tab)
  • Total stock display on the frontend shop or product pages
  • Low stock notifications or alerts
  • Stock history, purchase orders, or inventory forecasting

ATUM Inventory Management does the things on the right. This build covers the part most sites use.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (108 words)

Build a WordPress plugin that adds a sortable Total Stock column to the WooCommerce Products admin list (wp-admin/edit.php?post_type=product). For variable products, the column value is the sum of stock quantities across all variations where manage_stock is true; variations with manage_stock false are excluded from the sum. For simple products with manage_stock true, show the product's own stock quantity. For any product where no stock tracking is active, display a dash. Register the column using the manage_product_posts_columns and manage_product_posts_custom_column hooks, and make it sortable via manage_edit-product_sortable_columns and the pre_get_posts hook so clicking the column header sorts products by their total stock ascending or descending. No settings page is needed.