Is it possible to filter certain orders out of all WooCommerce reports?

On my WooCommerce site, I use a coupon to create free order subscriptions for certain testing purposes. I also use these to create subscription based orders for users who purchased the software we sell prior to switching to a subscription based system.

However, these free sales show up in all the WooCommerce reports so that it looks like we sold 11 when really we only sold 10.

Read More

So is it possible to write a function for my functions.php to only include orders where the total is greater than zero dollars in the reports?

Related posts

1 comment

  1. I think that can be done with a little customization. It would be easy if you know the concept of hooks and filter and also a knowledge of MySQL for Querying.

    For resolving your issue the filters you can use are ‘woocommerce_reports_get_order_report_data_args’ or ‘woocommerce_reports_get_order_report_query’.

    In the first filter you will get the args for the order report query where you will add the condition for not including the ids of order which has free order subscription.

    In the second filter you will get the query itself which will be used to find the order reports . You will have to modify the query with the same logic which will be excluding the orders with free subscriptions.

Comments are closed.