Skip to content

Inventory forecasting

The inventory forecasting module analyzes sales velocity from the last 90 days and predicts the stock depletion date for each product. The dashboard lets you quickly identify products that need restocking.

  1. The plugin fetches sales data from the last 90 days (orders with completed and processing status)
  2. It calculates the average daily sales (sales velocity) for each product
  3. Based on the current stock level and average sales, it predicts the depletion date
  4. Products are classified by restocking urgency
  5. Results are cached in a transient for 1 hour

Go to WooCommerce > Inventory Forecast to open the forecasting dashboard.

Three status cards are displayed at the top of the dashboard:

Card Condition Color
Critical Depletion within 7 days Red
Warning Depletion within 30 days Yellow
Healthy Depletion in 30+ days Green

Each card shows the number of products in that category.

Below the cards a table is displayed with details for each product:

Column Description
Product Product name with a link to the editor
Current stock Current quantity in stock
Average daily sales Average number of units sold per day (over 90 days)
Days to depletion Estimated number of days until zero stock
Forecast date Predicted stock depletion date
Suggested order Recommended quantity to order (30-day coverage)

The table is sorted by default on the “Days to depletion” column (ascending), so the products that need restocking soonest appear at the top.

The suggested order quantity is calculated using the formula:

suggested_order = average_daily_sales * 30

This value represents the quantity covering 30 days of demand.

The module adds a Forecast column to the products list (Products > All products). The column displays the estimated number of days to stock depletion with a colored indicator:

  • Red (critical): fewer than 7 days
  • Yellow (warning): 7-30 days
  • Green (healthy): more than 30 days

Products without stock tracking or with stock management disabled do not display a forecast.

Sales data is fetched directly from the database using a SQL query on the tables:

  • {prefix}woocommerce_order_items - order line items
  • {prefix}woocommerce_order_itemmeta - line item metadata (quantity, product_id)

Only orders with wc-completed and wc-processing status from the last 90 days are taken into account.

Forecasting results are stored in the WordPress transient cache with a lifetime of 1 hour:

  • Transient key: polski_pro_inventory_forecast
  • Expiration time: 3600 seconds (1 hour)
  • The cache is automatically refreshed after expiration

This avoids slow SQL queries on every dashboard load.

The module is controlled by a toggle on the Polski modules screen (module key inventory_forecast):

Polski > Modules > Inventory Forecast

After enabling the module, the Inventory Forecast item appears automatically in the WooCommerce menu.

This page is for informational purposes only and does not constitute legal advice. Polski PRO for WooCommerce is commercial software provided without warranty.