If orders placed before you entered or changed product costs show zero or outdated profit in Cost of Goods: Product Cost & Profit Calculator for WooCommerce, recalculate them. Go to WPFactory > Cost of Goods (also reachable at WooCommerce > Settings > Cost of Goods) > Tools and run the Orders recalculation tool.
Symptoms #
- Orders placed before you installed Cost of Goods, or before you filled in costs, show a cost and profit of 0.
- You changed a product cost, but older orders still use the old cost.
- WooCommerce Analytics and the admin orders list still show old figures after an update.
Why it happens #
Cost of Goods saves each product’s cost on the order line when the order is created. Later changes to a product cost do not touch orders that already exist, and orders created before a cost was set keep an empty cost. This protects your history, but it means past orders must be recalculated on purpose.
Causes and fixes #
- The orders need a recalculation (Pro). Open the Tools sub-tab and find the Orders recalculation tool group:
- Recalculate orders recalculates cost and profit for all orders. Its companion option Override item costs on recalculation is on by default and replaces the saved line costs with the current product costs. Turn it off if you only want the totals recalculated from the costs already saved on each order.
- Recalculate no cost orders only fills in orders that have no costs yet.
- Date (After and Before, plus Date type: Date created, Date modified, Date completed or Date paid) limits the run to a period.
Tick the option you need and click Save changes to start it. When the run covers at least the Minimum amount of orders set under Advanced > Background processing (default 100), it runs in the background and, with Send email on (the default), emails you when it is done. If large runs stop early, set PHP memory limit in the same Tools group.
- You are on the free version. The recalculation tool is Pro, but you can fix individual orders:
- Open the order and edit each line’s cost in the order edit screen. Orders > Admin Order Edit > Item costs is enabled by default.
- Set Orders > Admin Order Edit > “Recalculate” button to Fill in empty item costs with the default costs (or Fill in all item costs with the default costs), then click WooCommerce’s Recalculate button on the order.
- Or turn on Advanced > Order item costs > Auto fill empty order items costs on order update and update the order.
- New orders also show zero. Check Orders > Calculations > Delay calculations. If order statuses are selected there, all values stay at zero until the order reaches one of them. Leave it empty to calculate right away. See Profit Calculation Issues in WooCommerce Cost of Goods.
- Orders come from a POS, the REST API or another plugin. These orders may be created in a way that skips the cost calculation. See Cost and Profit Missing on Orders From POS, API or Other Plugins.
- Analytics still shows the old numbers. WooCommerce caches Analytics data. After a recalculation, clear it at WooCommerce > Status > Tools, as the plugin’s own Analytics sub-tab suggests.
How to confirm it is fixed #
- Open one of the old orders in the admin and check the Cost of Goods meta box: cost and profit should now be filled in.
- If you use the orders list columns, the Cost and Profit columns should show the new values.
- In WooCommerce Analytics, clear the cache and reload the report for the same period.
FAQ #
Does changing a product cost update past orders automatically? #
No. Past orders keep the cost saved when they were placed. Recalculate them with the tool above, or edit the order line costs.
Will a recalculation overwrite costs I typed into orders by hand? #
Yes, if Override item costs on recalculation is on (the default). Turn it off before running the tool to keep the costs saved on each order.
Still stuck? #
Send us an example order number and the costs you expected. Our team answers every ticket on the Cost of Goods support forum.
Get more from Cost of Goods #
Editing order line costs is free. Cost of Goods: Product Cost & Profit Calculator for WooCommerce Pro adds the orders recalculation tool, so you can bring years of orders up to date in one run. Get Cost of Goods Pro.
