WooCommerce reorder alerts based on supplier lead time: a plugin you can build today
· 5 min read
The WooCommerce low stock threshold is one number, set once in Settings > Products, applied to every product on the site. A store that sells two units a day and a store that sells thirty use the same logic: alert when stock reaches two. That works for shelf items your supplier ships overnight. It fails for anything with a four-week delivery window.
The failure mode is predictable: the alert fires on a Tuesday, the product runs out by Thursday, and your shipment does not land until early next month. Customers keep ordering. The backlog builds. The alert system did exactly what it was configured to do.
The correct calculation is a reorder point: average daily sales multiplied by the number of days it takes stock to arrive. That is standard inventory arithmetic, and WooCommerce already has all the data needed to do it. A small plugin adds one field per product, reads the last thirty days of order history, and tells you when to place an order before you run out.
What one build gives you
- A per-product Lead time (days) field on the WooCommerce Inventory tab
- Reorder point calculation from the last thirty days of completed orders
- A Reorder status column in the WooCommerce Products admin list
- A Reorder Report page showing stock, daily sales rate, reorder point, and days remaining per product
- A weekly admin email listing every product currently below its reorder point
What it does not do
- Variable products per variation: the calculation runs at the parent product level with all variations combined
- Safety stock: no buffer beyond the lead time calculation is included
- Purchase order creation or supplier contact integration
- Products with no recent sales history: items with zero completed orders in the last thirty days show no reorder status
- Seasonal forecasting: the thirty-day average reflects recent sales only, not peak season projections
Inventory Planner does these. This covers the part most sites use.
The prompt
Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.
Build a WooCommerce plugin called Reorder Point Manager. Plugin Name: Reorder Point Manager. Description: Per-product reorder alerts based on supplier lead time and 30-day sales velocity. Single PHP file. No dependencies beyond WooCommerce. Add a Lead time (days) number field to the WooCommerce product Inventory tab. Use the woocommerce_product_options_inventory_product_data action with woocommerce_wp_text_input. Field id and name: _reorder_lead_time, label: Lead time (days), type: number, custom_attributes min 1. Save on woocommerce_process_product_meta: cast to absint and store with update_post_meta. Only save if the product's manage_stock is enabled. Add a column Reorder status to the WooCommerce Products admin list using manage_edit-product_columns (add key rrm_status after the stock column) and manage_product_posts_custom_column. In the column callback, get the WC_Product object with wc_get_product. If manage_stock is not enabled or _reorder_lead_time is not set or is zero, output a dash. Otherwise query the database: count total quantity sold for this product_id from wp_woocommerce_order_items joined with wp_woocommerce_order_itemmeta for meta_key _product_id and wp_posts where post_status is wc-completed and post_date >= DATE_SUB(NOW(), INTERVAL 30 DAY). Divide total qty by 30 to get average_daily_sales. Calculate reorder_point as ceil(average_daily_sales * lead_time). Get current get_stock_quantity(). If stock_quantity <= reorder_point output a span with style color:#d63638 and text Reorder needed. If stock_quantity > reorder_point output a span with style color:#46b450 and text OK. Wrap all dynamic values in esc_html. Add a submenu page Reorder Report under WooCommerce using add_submenu_page, parent_slug woocommerce, capability manage_woocommerce, slug wc-reorder-report. On the page output a WP admin table. Query all published simple and variable products with manage_stock on and _reorder_lead_time set and greater than zero. For each product show: product name as a link to the edit screen, current stock, lead time in days, 30-day average daily sales to one decimal, calculated reorder point, estimated days of stock remaining (floor of stock divided by daily_sales, or the string Unlimited if daily_sales is zero), and status (Reorder needed in #d63638 or OK in #46b450). Escape all output. On plugin activation register a weekly cron event with wp_schedule_event(time(), weekly, rrm_weekly_report). On deactivation call wp_clear_scheduled_hook(rrm_weekly_report). In the rrm_weekly_report callback build the list of products below their reorder point using the same calculation as above. If the list is empty return without sending. Otherwise send a wp_mail to get_option(admin_email) with subject [site_name] Weekly reorder report and an HTML body containing a table listing product name, current stock, reorder point, and days remaining for each flagged product. Set content-type to text/html via the wp_mail headers argument.
Why a fixed threshold fails when lead times are long
WooCommerce's built-in low stock alert sits in Settings > Products > Low Stock Threshold and applies to every product in the store. The default in most setups is two. If you never changed it, every product is running on the same trigger regardless of how fast it sells or how long it takes to restock.
For a fast-moving product with a four-week lead time, by the time stock reaches two the reorder needed to happen weeks ago. The alert is mathematically correct and practically useless.
The problem compounds on high-volume stores. Thirty orders a day times twenty-eight days of lead time means you need 840 units in the pipeline before current stock hits the reorder trigger. A threshold of two is noise. The number you actually need is calculated from your specific product's sales rate and your specific supplier's delivery window.
How a reorder point is calculated
A reorder point is the stock level at which you place an order so that new stock arrives before old stock runs out. The formula is: reorder point = average daily sales multiplied by lead time in days. No external service, no forecast model.
If a product sold 180 units in the last thirty days, that is six per day on average. If your supplier takes three weeks to deliver, the reorder point is 6 times 21, or 126 units. When stock drops to 126, place the order. When stock drops below 126 without an order placed, you are already behind.
Adding a safety stock buffer is optional. Some operations pad with extra days as insurance against variable delivery times. The basic version without a buffer catches the problem for most stores and is the right starting point.
What the plugin adds to WooCommerce
A single Lead time (days) field on each product's Inventory tab. Set it in days: 7 for next-week delivery, 28 for a four-week supplier. Leave it blank on products where you do not manage stock or where the built-in threshold is sufficient.
A Reorder status column in the WooCommerce Products list. For each product with a lead time set, the column shows either OK in green or Reorder needed in red, calculated from the last thirty days of completed orders. Products with no lead time set show a dash.
A Reorder Report page under the WooCommerce admin menu listing every stock-managed product that has a lead time set, alongside its current stock, calculated reorder point, average daily sales, and estimated days of remaining stock. This is the screen to check before placing a supplier order.
A weekly cron that emails the site admin a digest of every product currently below its reorder point. The email only sends if there is something to report. If every product is above its reorder point, nothing is sent.
When Inventory Planner or ATUM is the better answer
This plugin answers one question: which products do I need to reorder right now. It does not create purchase orders, track them through fulfilment, contact suppliers, handle multi-supplier products, or forecast seasonal demand. If your operation needs any of those things, a dedicated inventory tool is worth the overhead.
Inventory Planner connects to WooCommerce and builds forecasts from full order history with adjustments for seasonality, promotions, and growth trends. ATUM's inventory module adds purchase order creation and supplier management on top of the reorder trigger. Both are justified for operations where reorder miscalculation is a meaningful business risk with real consequences.
A store that sells thirty products with steady demand and one supplier per product does not need that infrastructure. It needs to know when to place an order, calculated from data it already has. That is the scope this plugin covers, and for most stores running on WooCommerce's two-item default, it is the whole gap.
Questions
- Does this work for variable products?
The lead time field appears on the parent variable product. Sales across all variations are combined into one daily average, and the reorder point is calculated at the parent product level. Per-variation lead times are not supported.
- A product has had no sales in the last thirty days. What does the plugin show?
If a product has zero completed orders in the past thirty days, the daily sales rate is zero. The plugin shows a dash in the Reorder status column rather than a meaningless threshold. Use WooCommerce's built-in low stock threshold for slow-moving products.
- My supplier lead time varies by season or order volume. How do I handle that?
The field stores one number. Set it to the longest realistic lead time to stay safe, and update it manually when your supplier's schedule changes, such as before a peak season.
- Will the weekly email fire when every product is fine?
No. The weekly cron checks the reorder status and only sends the email if at least one product is currently below its reorder point. If everything is above threshold, nothing is sent.
- I just placed a supplier order. How do I stop the product being flagged?
Update the stock quantity in WooCommerce to reflect the incoming units, or wait until the order arrives and you update it then. The plugin reads live stock on each page load, so the flag clears automatically once the quantity exceeds the reorder point.
The prompt
Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.
Build a WooCommerce plugin called Reorder Point Manager. Plugin Name: Reorder Point Manager. Description: Per-product reorder alerts based on supplier lead time and 30-day sales velocity. Single PHP file. No dependencies beyond WooCommerce. Add a Lead time (days) number field to the WooCommerce product Inventory tab. Use the woocommerce_product_options_inventory_product_data action with woocommerce_wp_text_input. Field id and name: _reorder_lead_time, label: Lead time (days), type: number, custom_attributes min 1. Save on woocommerce_process_product_meta: cast to absint and store with update_post_meta. Only save if the product's manage_stock is enabled. Add a column Reorder status to the WooCommerce Products admin list using manage_edit-product_columns (add key rrm_status after the stock column) and manage_product_posts_custom_column. In the column callback, get the WC_Product object with wc_get_product. If manage_stock is not enabled or _reorder_lead_time is not set or is zero, output a dash. Otherwise query the database: count total quantity sold for this product_id from wp_woocommerce_order_items joined with wp_woocommerce_order_itemmeta for meta_key _product_id and wp_posts where post_status is wc-completed and post_date >= DATE_SUB(NOW(), INTERVAL 30 DAY). Divide total qty by 30 to get average_daily_sales. Calculate reorder_point as ceil(average_daily_sales * lead_time). Get current get_stock_quantity(). If stock_quantity <= reorder_point output a span with style color:#d63638 and text Reorder needed. If stock_quantity > reorder_point output a span with style color:#46b450 and text OK. Wrap all dynamic values in esc_html. Add a submenu page Reorder Report under WooCommerce using add_submenu_page, parent_slug woocommerce, capability manage_woocommerce, slug wc-reorder-report. On the page output a WP admin table. Query all published simple and variable products with manage_stock on and _reorder_lead_time set and greater than zero. For each product show: product name as a link to the edit screen, current stock, lead time in days, 30-day average daily sales to one decimal, calculated reorder point, estimated days of stock remaining (floor of stock divided by daily_sales, or the string Unlimited if daily_sales is zero), and status (Reorder needed in #d63638 or OK in #46b450). Escape all output. On plugin activation register a weekly cron event with wp_schedule_event(time(), weekly, rrm_weekly_report). On deactivation call wp_clear_scheduled_hook(rrm_weekly_report). In the rrm_weekly_report callback build the list of products below their reorder point using the same calculation as above. If the list is empty return without sending. Otherwise send a wp_mail to get_option(admin_email) with subject [site_name] Weekly reorder report and an HTML body containing a table listing product name, current stock, reorder point, and days remaining for each flagged product. Set content-type to text/html via the wp_mail headers argument.
Steem