as we all know from here: https://docs.woocommerce.com/document/reports/ that woocommerce counts in the sales by date & sales by product By default, orders marked Processing, On Hold and Completed are counted as sales.
What if we want to make it count the orders counted as completed status only ?
N.B: we need this to work in the sales by product and sales by date tab
2
Answers
You can use the
woocommerce_reports_get_order_report_data_args
filter to change the query. The following code should only show reports for completed orders for the ‘sales by date’ and ‘sales by product’ reports:This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets.
By the way, there is now a setting in WooCommerce Reports to do this: