I want to change a part of the get_order_report_data()
function inside class-wc-admin-report.php
without touching the core.
I would like to change the order status filter, right now it is:
$query['where'] = "
WHERE posts.post_type = 'shop_order'
AND posts.post_status = 'publish'
AND tax.taxonomy = 'shop_order_status'
AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "')
";
And I want to change the term.slug to custom_status
.
I don't now how to do this with a plugin or something like that
This question seems a bit muddled, but here is my best interpretation.
If you want to add a custom status to capture in the query write a filter function like this:
Later on in the function all the statuses in that array get 'wc-' appended to their values for the actual query string. So you'll need your status to have that prefix. Or... you can modify the querystring with a later filter:
All this filter code gets added to your theme
functions.php
or custom plugin code.