• Resolved gilesytheking

    (@gilesytheking)


    How can I hide/exclude orders that are “On Hold” from reports?

    All the orders that I set to “On Hold” are confirmed/completed but are pending payment. For example a product is ordered online or via phone an will be paid for upon collection. The stock is reduced, however I do not want the sale to appear in the reports until I have received the cash and order status changed to “complete”

    As per woo docs – https://docs.woothemes.com/document/reports/ – By default, orders that are marked as “Processing”, “On Hold”, and “Completed” are counted as sales in the reports.

    How can I hide/exclude orders that are “On Hold” from reports?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter gilesytheking

    (@gilesytheking)

    Any ideas people? There must be something I can hook into to exclude on hold orders from reports.

    Thread Starter gilesytheking

    (@gilesytheking)

    I have found the following function “exclude_from_order_sales_reports” how can I use this to remove “on hold” orders from sales reports?

    https://docs.woothemes.com/wc-apidocs/function-wc_register_order_type.html

    https://docs.woothemes.com/wc-apidocs/source-function-wc_register_order_type.html#167-221

    LucasFavaro

    (@lucasfavaro)

    I want to know too. I have tried everything but I can’t find a solution for that!

    Thread Starter gilesytheking

    (@gilesytheking)

    Is there anyone with some coding experience that can solve this? I can offer a case of beer for a solution =)

    i seen on woocommerce main report class WC_Admin_Report on line 67 they have filter like this $order_status = apply_filters( 'woocommerce_reports_order_statuses', $order_status );

    so i think you can easily alter the default order status for reports by adding filter like this on your functions.php

    add_filter( 'woocommerce_reports_order_statuses', 'my_custom_order_status_for_reports', 10, 1 );
    function my_custom_order_status_for_reports($order_statuses){
    	$order_statuses = array('completed'); // your order statuses for reports
    
    	return $order_statuses;
    }

    ahh, and a cup of coffee would be better than beer @gilesytheking ??

    Thread Starter gilesytheking

    (@gilesytheking)

    Thanks for your reply and great coding. I’m sending a cup of the finest coffee your way, milk and sugar?

    After a lot of searching I found a plugin that does exactly what I was after. WooCommerce Order Status Manager – allows you to create custom order status and has options to include/exclude from reports. Also has some other cool settings.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide "ON HOLD" orders from reports’ is closed to new replies.