Support » Plugin: Advanced Order Export For WooCommerce » Customer_Total_Orders Field

  • Hi, first thanks for the great plugin.

    I’m looking to format a sales ranking through the report.

    However, the Customer_Total_Orders field does not match the selected filters.

    Regardless of the selected date or the status of the selected orders, the Customer_Total_Orders field shows the customer’s total order, adding status as canceled and period different from the selected date.

    Would it be possible for the Customer_Total_Orders field to only show according to the selected filter?

    See that I use date and status filters: Screenshot

    I also tried a custom code that I saw here in another post: screenshot

    But the result shows the total of orders regardless of the selected status and the date: screenshot


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author


    so on last screenshot , you want to see “4” ?

    you can count number of exported orders and fill this column at end of export.
    use hook woe_xls_print_footer
    there are some examples at page

    but you must use PHPExcel to write/read cells.

    thanks, Alex

    Thread Starter Flávio


    thanks for the feedback @algolplus

    Yes, I wanted to display “4” in Customer_Total_Orders according to the selected filters.

    I thought it was just the implementation of some code in “Custom PHP code to modify output”, more advanced customizations like the one you suggested to me at the moment I can’t.

    If anyone can help. I thank.


    Plugin Author


    Hello @fuba182

    Please, add this code to section “Misc Settings”.
    I assume you set “Sort orders by” = _billing_email.
    This code checks column “B” and updates column “G”.
    It’s based on your screenshot.
    thanks, Alex

    add_action( 'woe_xls_print_footer', function ($objPHPExcel,$formatter) {
    	$customer_email = false;
    	$customer_started_at = 0;
    	$customer_orders = 0;
    	for($i=2;$i<=$formatter->last_row;$i++) {
    		$email = $objPHPExcel->getActiveSheet()->getCell('B'.$i)->getValue();
    		if($email != $customer_email) {
    			$customer_email = $email;
    			$customer_orders = 1;
    			$customer_started_at = $i;
    	if($customer_started_at) {
    }, 10, 2); 
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.