You can put code to textarea “Custom PHP code” in section “Misc Settings” (except codes from section “Add Fields”! ).

Codes from section “Add Fields” should be added via this plugin (otherwise you must put it to functions.php).
Pro users should set mode “Run snippet everywhere” if they use  scheduled jobs!

The snippets are grouped by purpose: Add Fields, Add Product Rows, Sort orders, Filter orders, Format output, Tweak email, HTTP Post, Actions after export, Alter summary report, Sample addons, Columns for each currency, Export Sales/Taxes report, Sort by product names, Add products as columns

Use documentation to understood naming for hooks/filters

Modify Existing Fields

// add order prefix
add_filter('woe_get_order_value_order_number', function ($value, $order, $fieldname) {
	return "KTR-" . $value;
}, 10, 3);
// remove line breaks from customer note 
add_filter('woe_get_order_value_customer_note',function ($value, $order,$fieldname) {
	return preg_replace( "/\r|\n/", "", $value);
},10,3);
//  swap   last  and  first  names in  "Shipping Full Name"
add_filter('woe_get_order_value_shipping_full_name',function ($value, $order,$fieldname) {
	return $order->get_shipping_last_name(). ' '  . $order->get_shipping_first_name();
},10,3);
// remap shipping method titles
add_filter('woe_get_order_value_shipping_method_title', function ($value, $order, $fieldname) {
	if($value == 'Flat rate') // copy these 2 lines for other mappings
		$value = 'STANDARD'; 
	return $value;
}, 10, 3);
// format product weight, 0.2->0.200  and 0.12->0.120
add_filter('woe_get_order_product_value_weight', function ($value, $order, $item, $product,$Item_meta) {
	return number_format($value,3,'.','');
}, 10, 5);
// fix problem with apostrophe in "WC Fields Factory"
add_filter( "woe_get_order_product_item_meta", function($item_meta ){
	foreach($item_meta as $k=>$v) {
		$k2 = html_entity_decode ($k,ENT_QUOTES);
		$item_meta[$k2] = $v;
	}
	return $item_meta;
});
// fill empty shipping address 
add_filter( "woe_fetch_order", function ($row, $order) {
	if( empty($row['shipping_address_1']) ) {
		// overwrite address
		$row['shipping_address_1'] = $row['billing_address_1'];
		$row['shipping_address_2'] = $row['billing_address_2'];
		$row['shipping_city'] = $row['billing_city'];
		$row['shipping_state'] = $row['billing_state'];
		$row['shipping_postcode'] = $row['billing_postcode'];
	}
	return $row;
},10,2);
//convert "order total" and "item price"  from CNY to USD
class WOE_currency_mod {
	var $rate = false;
	
	function __construct() {
		add_filter('woe_get_order_value_order_total',array($this,'convert_cny_usd'), 10, 3);
		add_filter('woe_get_order_product_value_item_price',array($this,'convert_cny_usd'), 10, 3);
	}	
	
	function convert_cny_usd($value, $order,$fieldname) {
		return round( $value * $this->get_rate(), 2 );
	}
	
	function get_rate() {
		if( $this->rate === false) {
			$response = wp_remote_get("http://ratesapi.io/api/latest?base=CNY&symbols=USD");
			$api_response = json_decode( wp_remote_retrieve_body( $response ), true );
			$this->rate = $api_response['rates']['USD'];
		}
		return $this->rate;
	}
}	
new WOE_currency_mod();

Add New Fields

You can create new field via via user interface too.

For example, I want to export string like “Rain x 4, Lemon x 2, Other product x Qty”,
so I create field using meta key “all_products”


and put following code to section “Misc Settings”

add_filter('woe_get_order_value_all_products',function ($value, $order,$fieldname) {
	$lines = array();
	foreach($order->get_items() as $item) {
		$lines[] = $item["name"]. " x " .$item["qty"];
	}
	return join(",  ",  $lines);
},10,3);
Extra custom fields, meta key must be added via UI, see exact name in code!
//export Shipping Zone, add meta key "zone_name"
add_filter('woe_get_order_value_zone_name',function ($value, $order,$fieldname) {
  $methods = $order->get_items( 'shipping' );
  $method  = reset( $methods ); // take first entry
  if ( ! empty( $method ) ) {
        $zone  = WC_Shipping_Zones::get_zone_by('instance_id',$method['instance_id']);
        $value  = $zone->get_zone_name();
  }
  return $value;
},10,3);
//export Geolocation Country, add meta key "geolocation_country"
add_filter('woe_get_order_value_geolocation_country',function ($value, $order,$fieldname) {
	$user_ip_address = $order->get_customer_ip_address();
	$geolocation_instance = new WC_Geolocation();
	$user_geolocation = $geolocation_instance->geolocate_ip( $user_ip_address );
	$value =  $user_geolocation['country'];
	return $value;
},10,3);
// export ATUM supplier, add meta key "atum_supplier"
add_filter('woe_get_order_product_value_atum_supplier', function ($value, $order, $item, $product,$item_meta) {
	if($product AND  class_exists("Atum\Inc\Helpers") ) {
		$product = Atum\Inc\Helpers::get_atum_product( $product->get_id() );
		$supplier_id = $product->get_supplier_id();
		if ( $supplier_id ) {
			$supplier_post = get_post( $supplier_id );
			if ( $supplier_post ) 
				$value = $supplier_post->post_title;
		}
	}
	return $value;
}, 10, 5);

Some samples for adding fields via code
// add order field "Order Time"
add_filter('woe_get_order_fields', function ($fields) {
	$fields['order_time'] = array( 'label' => 'Order Time', 'colname' => 'Order Time', 'checked' => 1 );
	return $fields;
});
// calculate new field
add_filter('woe_get_order_value_order_time', function ($value,$order, $field) {
	return $order->get_date_created()->date("H:i:s");
}, 10, 3);
// add product field "Quantity x Name"
add_filter('woe_get_order_product_fields', function($fields,$format) {
	$fields['qty_name'] = array( 'label' => 'Quantity x Name', 'colname' => 'Quantity x Name', 'checked' => 1 );
	return $fields;
},10, 2);

add_filter('woe_get_order_product_value_qty_name', function($value,$order, $item, $product,$item_meta) {
	return $item['qty'] .' x '. $item['name'];
}, 10, 5);
 // add field  "Invoice Numbers", for Germanized Pro
add_filter('woe_get_order_fields', function ($fields) {
	$fields['german_invoice_numbers'] = array( 'label' => 'Invoice Numbers', 'colname' => 'Invoice Numbers', 'checked' => 1 );
	return $fields;
});

add_filter('woe_get_order_value_german_invoice_numbers', function ($value,$order, $field) {
	$invoices = wc_gzdp_get_invoices_by_order( $order );
	if( $invoices ) {
		$numbers = array();
		foreach ( $invoices as $id => $invoice ) {
			$numbers[] = $invoice->get_title();
		}
		$value = join(", ", $numbers);
	}
	return $value;
}, 10, 3);
// add field "Date Processed", based on order's comments
add_filter('woe_get_order_fields', function ($fields) {
    $fields['date_processed'] = array( 'label' => 'Date Processed', 'colname' =>'Date Processed', 'segment' => 'common', 'format'=>'date', 'checked' => 1 );
    return $fields;
});
add_filter('woe_get_order_value_date_processed', function ($value,$order,$fieldname) {
    $args = array(
		'post_id' 	=> $order->id,
		'approve' 	=> 'approve',
		'type' 		=> 'order_note',
		'search'        => 'Order status changed from Pending Payment to Processing.',
    );
    // woocommerce hides such records by default
    remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10 );
    $notes = get_comments( $args );
    add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

    $date_processed = '';
    if(!empty($notes)) {
        $date_processed = $notes[0]->comment_date;
    }
    return $date_processed;
},10, 3);
//add all taxes as columns
class WOE_add_all_taxes{
	var $taxes;
	
	function __construct() {
		add_filter('woe_get_order_fields', array($this,'add_order_fields'), 10, 1);
		add_filter('woe_settings_validate_defaults', array($this,'hook_new_fields'), 10, 1);
		add_filter('woe_order_export_started',array($this,'fetch_order_taxes'), 10, 1);
	}	
	
	function add_order_fields($fields) {
		global $wpdb;
		
		$taxes = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates");
		foreach($taxes  as $tax) {
			$fields['tax_'.$tax->tax_rate_id] = array('label'=>$tax->tax_rate_name,'checked' => 1, 'segment'=>'cart','colname'=>$tax->tax_rate_name, 'format'=>'money');
		}	
		return $fields;
	}
	
	function hook_new_fields($settings) {
		global $wpdb;
		
		$taxes = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates");
		foreach($taxes  as $tax) {
			add_filter('woe_get_order_value_tax_'.$tax->tax_rate_id, array($this,'get_tax_value'), 10, 3);
		}	
		return $settings;
	}	

	function fetch_order_taxes($order_id) {
		//reset values
		$this->taxes = array();
		//read taxes
		$order = new WC_Order($order_id);
		foreach($order->get_tax_totals() as $code=>$tax) {
			$this->taxes['tax_'.$tax->rate_id ] =  wc_round_tax_total($tax->amount);
		}
		return $order_id;
	}
	
	function get_tax_value($value, $order,$field) { 
		return isset($this->taxes[$field]) ? $this->taxes[$field] : 0;
	}
}	
new WOE_add_all_taxes();
//add fees as columns
class WOE_add_fees_columns{
	var $order_fees;
	var $fee_columns;
	
	function __construct() {
		add_filter('woe_get_order_fields', array($this,'add_order_fields'), 10, 1);
		add_filter('woe_settings_validate_defaults', array($this,'hook_new_fields'), 10, 1);
		add_filter('woe_order_export_started',array($this,'fetch_order_fees'), 10, 1);
	}	
	
	//1 add to UI
	function add_order_fields($fields) {
		global $wpdb;
		$fees = $wpdb->get_results("SELECT DISTINCT order_item_name FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_type='fee' ORDER BY order_item_name");
		foreach($fees as $fee) {
			$key = 'fee_'.md5($fee->order_item_name);
			$fields[ $key ] = array('label'=>$fee->order_item_name,'checked' => 1, 'segment'=>'cart','colname'=>$fee->order_item_name, 'format'=>'string');
			
			$key = 'fee_tax_'.md5($fee->order_item_name);
			$fields[ $key ] = array('label'=>$fee->order_item_name. " Tax",'checked' => 1, 'segment'=>'cart','colname'=>$fee->order_item_name. " Tax", 'format'=>'string');
			
			$key = 'fee_plus_tax_'.md5($fee->order_item_name);
			$fields[ $key ] = array('label'=>$fee->order_item_name. " + Tax",'checked' => 1, 'segment'=>'cart','colname'=>$fee->order_item_name. " + Tax", 'format'=>'string');
		}	
		return $fields;
	}

	// 2 set hooks for new fields 
	function hook_new_fields($settings) {
		global $wpdb;
		$fees = $wpdb->get_results("SELECT DISTINCT order_item_name FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_type='fee' ORDER BY order_item_name");
		foreach($fees as $fee) {
			$key = 'fee_'.md5($fee->order_item_name);
			add_filter('woe_get_order_value_'.$key, array($this,'get_fee_value'), 10, 3);
			
			$key = 'fee_tax_'.md5($fee->order_item_name);
			add_filter('woe_get_order_value_'.$key, array($this,'get_fee_value'), 10, 3);
			
			$key = 'fee_plus_tax_'.md5($fee->order_item_name);
			add_filter('woe_get_order_value_'.$key, array($this,'get_fee_value'), 10, 3);
		}	
		return $settings;
	}
	function get_fee_value($value, $order, $field) { 
		return isset($this->order_fees[$field]) ? $this->order_fees[$field] : 0;
	}

	//3 get data from order 
	function fetch_order_fees($order_id) {
		//reset values
		$this->order_fees = array();
		
		//read fees
		$order = new WC_Order($order_id);
		foreach($order->get_items('fee') as $item_id => $item) {
			$name = $item->get_name();

			$key = 'fee_'.md5($name);
			$total = $item->get_total();
			$total = floatval($total);
			$this->order_fees[ $key ] =  $total;

			$key = 'fee_tax_'.md5($name);
			$total_tax = $item->get_total_tax();
			$total_tax = floatval($total_tax);
			$this->order_fees[ $key ] =  $total_tax;

			$total_totalTax = $total + $total_tax;
			$key = 'fee_plus_tax_'.md5($name);
			$this->order_fees[ $key ] = $total_totalTax;
		}
        
		return $order_id;
	}
	
}	
new WOE_add_fees_columns();

Add Product Rows

// duplicate each item "qty" times! and set qty=1 for the item
add_filter( "woe_fetch_order_products", function ($products, $order, $labels, $format, $static_vals) {
	$new_products = array();
	//need to know counters, as field "qty" can be omitted in output!
	foreach($order->get_items('line_item') as $pos=>$item) {
				if( !isset($products[$pos]) )
						continue;
				if( isset($products[$pos]['qty']) )
						$products[$pos]['qty'] =1;
				for($i=0;$i< $item['qty'];$i++) 
						$new_products[] = $products[$pos];
	} 
	return $new_products;
} , 10, 5);
//export Shipping line as Products 
add_filter('woe_fetch_order_products', function ($products,$order,$labels, $format, $static_vals) {
	$i = count ($products);
	foreach ( $order->get_items('shipping') as $item_id=>$item ) {
		$row = array();
		$i++;
		$taxes = $item->get_total_tax();
		foreach ( $labels as $field => $label ) {
			if ( $field == 'line_id' ) {
				$row[ $field ] = $i;
			} elseif ( $field == 'sku' ) {
				$row[ $field ] = $item["method_id"];
			} elseif ( $field == 'name' ) {
				$row['name'] = $item["name"];
			} elseif ( $field == 'qty' ) {
				$row['qty'] = 1;
			} elseif ( $field == 'item_price' ) {
				$row['item_price'] = $item["cost"];
			} elseif ( $field == 'price' ) {
				$row['price'] = $item["cost"];
			} elseif ( $field == 'line_tax' ) {
				$row['line_tax'] = $taxes;
			} elseif ( $field == 'tax_rate' ) {
				$row['tax_rate'] = $item["cost"] ? round($taxes/$item["cost"] *100 , 2) : 0;
			} elseif ( isset( $static_vals[ $field ] ) ) {
				$row[ $field ] = $static_vals[ $field ];
			} 
		}
		$products[] = $row;
	}
	return $products;
}, 10, 5);
//export Fee line as Products
add_filter('woe_fetch_order_products', function ($products, $order, $labels, $format, $static_vals) {
    $i = count($products);
    foreach($order-> get_items('fee') as $item_id => $item) {
        $item_meta = $order->get_item_meta( $item_id );
        $fee_amount = $item_meta['_fee_amount'][0];
        $tax_amount = $item_meta['_line_tax'][0];
        $row = array();
        $i++;
        foreach($labels as $field => $label) {
            if ($field == 'line_id') {
                $row[$field] = $i;
            }
            elseif($field == 'name') {
                $row['name'] = $item["name"];
            }
            elseif($field == 'qty') {
                $row['qty'] = 1;
            }
            elseif($field == 'tax_rate') {
                $row[$field] = round($tax_amount/$fee_amount*100);
            }
            elseif($field == 'line_no_tax') {
                $row[$field] = $fee_amount;
            }
            elseif($field == 'line_tax') {
                $row[$field] = $tax_amount;
            }
            elseif($field == 'line_subtotal') {
                $row[$field] = $fee_amount;
            }
            elseif($field == 'line_total') {
                $row[$field] = $fee_amount;
            }
            elseif($field == 'line_total_plus_tax') {
                $row[$field] = $fee_amount + $tax_amount;
            }
            elseif($field == 'item_price') {
                $row[$field] = $fee_amount;
            }
            else {
                $row[$field] = $item[$field];
            }
        }
        $products[] = $row;
    }
    return $products;
}, 10, 5);
//add summary row to PDF report
class Woe_PDF_Summary {
	var $summary_cols = array(9,10,11); // columns starts from 0!
	var $num_columns = 11;// last column position 
	var $totals;
	
	function __construct() {
		//init
		add_action( 'woe_pdf_started', function($pdf, $formatter){
			$this->totals = array();
			foreach($this->summary_cols as $pos)
				$this->totals[$pos] = 0;
		},10,2);
		
		//sum rows
		add_filter( 'woe_pdf_prepare_row', function($row){
			foreach($this->summary_cols as $pos)
				$this->totals[$pos] += (float)$row[$pos];
			return $row;    
		},10,1);
		
		//add footer
		add_action("woe_pdf_finished", function($pdf, $formatter){
			$row = array("", "","", "Total","IDR" ); //just texts
			//add missed columns
			for($i=0; $i<$this->num_columns; $i++)
				$row[$i] = isset($row[$i]) ? $row[$i] : "";
				
			//fill summary 
			foreach($this->totals as $pos=>$val)
				$row[$pos] = $val;
			$pdf->addRow( $row, null, null );
		},10,2);
	}    
}    
new Woe_PDF_Summary();

Sort orders

// sort products by SKU (inside one order)
add_filter('woe_fetch_order_products', function ($products, $order, $labels, $format, $static_vals) {
	usort($products, function($a, $b){
		if ($a['sku'] == $b['sku']) return 0;
		return ($a['sku'] < $b['sku']) ? -1 : 1;
	});
	return $products;
},10, 5);
// sort products by SKU , summary  report
add_action( 'woe_summary_before_output', function() {
	uasort( $_SESSION['woe_summary_products'], function ( $a, $b ) {
		return strcmp( $a['sku'], $b['sku'] );
	} );
});
// sort orders by billing full name using SQL filters
add_filter('woe_sql_get_order_ids_left_joins', function ($joins) {
	global $wpdb;
	$joins[] = "LEFT JOIN {$wpdb->postmeta} AS billing_last ON (billing_last.post_id = orders.ID AND billing_last.meta_key='_billing_last_name')";
	$joins[] = "LEFT JOIN {$wpdb->postmeta} AS billing_first ON (billing_first.post_id = orders.ID AND billing_first.meta_key='_billing_first_name')";
	return $joins;
});
add_filter('woe_sql_get_order_ids_fields', function ($fields) {
 	return "ID AS order_id, CONCAT(billing_first.meta_value,billing_last.meta_value) AS billing_name";
});
add_filter('woe_sql_get_order_ids_order_by', function ($order_by) {
	return "ORDER BY billing_name";
});
// sort by usernames using SQL filters
add_filter('woe_sql_get_order_ids_left_joins',function ($joins) {
	global $wpdb;
	$joins[] = "LEFT JOIN {$wpdb->postmeta} AS order_usernames ON (order_usernames.post_id = orders.ID AND order_usernames.meta_key='_customer_user')";
	$joins[] = "LEFT JOIN {$wpdb->users} AS users ON users.ID = order_usernames.meta_value";
	return $joins;
});
add_filter('woe_sql_get_order_ids_fields', function ($fields) {
 	return "orders.ID AS order_id,users.user_login AS username";
 });
add_filter('woe_sql_get_order_ids_order_by', function ($order_by) {
	return "ORDER BY username DESC";
});

Filter orders

//  export only orders with total > 10
add_filter( 'woe_order_export_started',  function ( $order_id ) { 
  $order = new WC_Order($order_id);
  return   ($order->get_total()  > 10.00) ? $order_id: false;
});
// replace {yesterday} and {today}  with actual values comparison operators
// tweak formats for your needs!
add_filter('woe_settings_validate_defaults', function ($settings) {
	$settings = json_encode($settings); // to string
	$yesterday = date("Y-m-d" , strtotime("-1 day",  current_time( 'timestamp' ) ));
	$settings = str_replace( '{yesterday}', $yesterday, $settings);
	$today = date("Y-m-d" , current_time( 'timestamp' ) );
	$settings = str_replace( '{today}', $today, $settings);
	$settings = json_decode($settings, true); // to array
	return $settings;
} );

Format output

// CSV without quotes
add_filter('woe_csv_custom_output_func', function ($custom_output,$handle,$data,$delimiter,$linebreak,$enclosure,$is_header) {
	fwrite($handle, join($delimiter, $data).$linebreak );
	$custom_output = true; //stop fputcsv!
	return $custom_output;
}, 10, 7);
// CSV force quotes
add_filter('woe_csv_custom_output_func',function ($custom_output,$handle,$data,$delimiter,$linebreak,$enclosure,$is_header) {
	foreach($data as $k=>$v) 
		$data[$k] =  $enclosure . str_replace($enclosure, $enclosure . $enclosure, $v) . $enclosure;
	fwrite($handle, join($delimiter, $data). $linebreak  );
	return true;  //stop default fputcsv!
}, 10, 7);
//CSV, replace umlauts with ASCII characters
add_filter( "woe_csv_output_filter", function($row, $formatter){
	return array_map( "remove_accents", $row ); 
},10,2);
//convert all values to UPPER case
add_filter('woe_fetch_order', function($row,$order){
  array_walk_recursive($row, function(&$item,$key) {
          $item = strtoupper($item);
  });
  return $row;
},10,2);
// add empty row after each order,   Excel/CSV/TAB formats
add_filter("woe_fetch_order_data", function($rows) {
	$rows[] = array("");
	return $rows;
});
// print date range above header, Excel format
add_action( 'woe_xls_print_header', function($objPHPExcel, $formater ) {
  $objPHPExcel->getActiveSheet()->insertNewRowBefore(1,2);  //2 lines above header
  $formater->last_row += 2 ; //2 rows
  $objPHPExcel->getActiveSheet()->setCellValue( "A1", "From Date:" );
  $objPHPExcel->getActiveSheet()->setCellValue( "B1", $formater->settings['global_job_settings']['from_date'] );
  $objPHPExcel->getActiveSheet()->setCellValue( "C1", "To Date:" );
  $objPHPExcel->getActiveSheet()->setCellValue( "D1", $formater->settings['global_job_settings']['to_date'] );
},10,2);
// format Excel column as number
add_action( 'woe_xls_print_footer', function ($objXls,$formatter) {
 $row = $formatter->last_row;
 $objXls->getActiveSheet()->getStyle( "C1:C" . $row)->getNumberFormat()->setFormatCode('0.00');
}, 10, 2); 
// sum Excel column
add_action( 'woe_xls_print_footer', function ($objXls,$formatter) {
 $row = $formatter->last_row;
 // edit column names below! 
 $formatter->objPHPExcel->getActiveSheet()->setCellValue( "A". ($row+1), "Orders Total:" );
 $formatter->objPHPExcel->getActiveSheet()->setCellValue( "B". ($row+1), "=SUM(B2:B$row)");
} ,10, 2);  
// fixed width, you should use format TSV! 
add_filter('woe_tsv_custom_output_func', function ($custom_output,$handle,$data,$delimiter,$linebreak,$enclosure,$is_hader) {
	$default_len = 10;
	$len = array(20,20,20,20,20,20,20,20,20,20); //define  width for each column

	$data = array_values($data);
	foreach( $data as $pos=>$v) {
		$l =  isset($len[$pos]) ?  $len[$pos] : $default_len;
		$v = substr($v, 0, $l);// truncate long values
		$data[$pos] = str_pad($v, $l, " ", STR_PAD_RIGHT); // or STR_PAD_LEFT ? edit it!
	}
	
	fwrite($handle, join("", $data). $linebreak);
	return true; //stop fputcsv!
}, 10, 7);
//add section  "customer" to  json 
add_filter('woe_json_output_filter', 	function ($json,$data) {
	$order = new WC_Order(WC_Order_Export_Engine::$order_id);
	$data['customer'] = array();
	$data['customer']['name'] = $order->get_shipping_first_name()." ".$order->get_shipping_last_name();
	$data['customer']['email'] = $order->get_billing_email();
	$data['customer']['phone'] = $order->get_billing_phone();
	$data['customer']['address1'] = $order->get_shipping_address_1();
	$data['customer']['address2'] = $order->get_shipping_address_2();
	$data['customer']['city'] = $order->get_shipping_city();
	$data['customer']['state'] = $order->get_shipping_state();
	$data['customer']['country'] = $order->get_shipping_country();
	$data['customer']['zip'] = $order->get_shipping_postcode();
	return json_encode($data,JSON_PRETTY_PRINT);
},10,2);
// add "other" items as separate section to json
add_filter( "woe_json_output_filter", function($json, $record, $formatter){
	$record['others'] =  woe_get_order_others(WC_Order_Export_Engine::$order_id); // EDIT key 
	return json_encode($record,JSON_PRETTY_PRINT);	
},10,3);
function woe_get_order_others($order_id) {
	global $wpdb;
	$results = array();
	$types = array( 'fee'=>'_fee_amount', 'shipping'=>'cost', 'tax'=>'tax_amount');
	
	foreach($types as $type=>$key) {
		$items = $wpdb->get_results("SELECT items.order_item_name, itemmeta.meta_value FROM {$wpdb->prefix}woocommerce_order_items items
				INNER JOIN  {$wpdb->prefix}woocommerce_order_itemmeta itemmeta
				ON items.order_item_id = itemmeta.order_item_id AND itemmeta.meta_key = '$key'
				WHERE items.order_id = $order_id  AND items.order_item_type = '$type'"
				);
		foreach($items as $item)		
			$results[ $item->order_item_name ] = $item->meta_value;
	}	
	return $results;
}
//color PDF rows, you must include "Order Number" to export !
class Woe_Color_PDF{
	var $order_number_position = 0; // EDIT it , as we need to know order number, positions start from 0
	var $table_row_settings;// use UI to set background color for "odd" orders
	var $even_background_color = array(220, 220, 220);
	var $order_counter = 0;
	var $order_number_current = "";
	
	function __construct() {
		//remember default row formatting 
		add_filter("woe_formatter_pdf_properties", function($pdf_settings){
			$this->table_row_settings = $pdf_settings['table_row'];
			return $pdf_settings;
		});
		
		//count orders 
		add_filter( 'woe_pdf_before_print_row', function($style, $row, $pdf,$formatter){
			$order_number = $row[$this->order_number_position];
			// new order not started 
			if( $order_number != "" AND $order_number != $this->order_number_current)
				$this->order_counter++;
			// count orders 
			$this->order_number_current = $order_number;
			$pdf_row_settings = $this->table_row_settings;
			if( $this->order_counter % 2 == 0 ) { // even order uses  own color
				$pdf_row_settings['background_color'] = $this->even_background_color;
			}
			//done	
			return $pdf_row_settings;
		},10,4);
	}    
}
new Woe_Color_PDF();
// custom XML
add_filter("woe_xml_output_filter","woe_xml_make_order");
function woe_xml_make_order($xml) {
 // get order 
 $order = new WC_Order(WC_Order_Export_Engine::$order_id);

 //make xml
 $xml = new SimpleXMLElement( "<Order/>" );

 // top
 $xml->addChild("OrderNumber", $order->get_order_number() );
 $xml->addChild("CustomerNumber", $order->get_customer_id() );

 // addresses
 $addr = $xml->addChild("Addresses");
 $b_addr = $addr->addChild("BillingAddress");
 $b_addr->addChild("FirstName",$order->get_billing_first_name() );
 $b_addr->addChild("LastName",$order->get_billing_last_name() );
 $b_addr->addChild("Street", trim( $order->get_billing_address_1() . " " . $order->get_billing_address_2() ) );
 $b_addr->addChild("Zipcode",$order->get_billing_postcode() );
 $b_addr->addChild("City",$order->get_billing_city() );
 $s_addr = $addr->addChild("ShippingAddress");
 $s_addr->addChild("FirstName",$order->get_shipping_first_name() );
 $s_addr->addChild("LastName",$order->get_shipping_last_name() );
 $s_addr->addChild("Street", trim( $order->get_shipping_address_1() . " " . $order->get_shipping_address_2() ) );
 $s_addr->addChild("Zipcode",$order->get_shipping_postcode() );
 $s_addr->addChild("City",$order->get_shipping_city() );

 // items
 $items = $xml->addChild("LineItems");
 foreach ( $order->get_items('line_item') as $item_id=>$item ) {
   $product   = $order->get_product_from_item( $item );
   $item_meta = get_metadata( 'order_item', $item_id );

   $itemXML = $items->addChild("LineItem");
   $itemXML->addChild("Id",$product->get_sku() );
   $itemXML->addChild("Name",$item['name']);
   $itemXML->addChild("Quantity",$item['qty']);
 }
 

 // shipment 
 $ship = $xml->addChild("LineItemShipping");
 $shipping_methods = $order->get_items( 'shipping' );
 $shipping_method = reset($shipping_methods); // take first entry
 $shipping_method_id =  !empty($shipping_method) ?  $shipping_method['method_id'] : '' ;
 $ship->addChild("Id",$shipping_method_id);
 $ship->addChild("TotalPrice",$order->get_total_shipping() );
 $ship->addChild("Name",$order->get_shipping_method() );

 // payment 
 $pay = $xml->addChild("LineItemPayment");
 $pay->addChild("Id",$order->get_payment_method() );
 $pay->addChild("TotalPrice",$order->get_total() );
 $pay->addChild("Name",$order->get_payment_method_title() );

 //bottom
 $xml->addChild("CreationDate", $order->get_date_created() );
 $xml->addChild("ShippedOn", $order->get_date_completed() );
 //format it!
 $dom = dom_import_simplexml( $xml );
 $dom->ownerDocument->formatOutput = true;
 $xml =  $dom->ownerDocument->saveXML( $dom->ownerDocument->documentElement );
 return $xml;
}

Tweak email

// support tag {ordernumber} in filename
add_filter('woe_make_filename_replacements', function ($pairs) {
	$order= new WC_Order( WC_Order_Export_Engine::$order_id);
	$pairs['{ordernumber}'] = $order->get_order_number(); // tweak it ?
	return $pairs;
});
// tags {prev_mon} and {prev_year}  can be used in  filename
add_filter('woe_make_filename_replacements',function($pairs) {
	$t = strtotime("previous month");
	$pairs['{prev_mon}'] = date('m',$t);
	$pairs['{prev_year}'] = date('Y',$t);
	return $pairs;
});
// tag {date_sent} can be used in  email subject
add_filter("woe_export_email_subject",function($subject){
   $date = current_time("d/m/y");
   return str_replace("{date_sent}",$date,$subject);
});

HTTP Post

// modify Content-Type for HTTP Post ( Pro version)
add_filter('wc_order_export_http_args', function ($args) {
	$args['headers']['Content-Type'] = "text/csv";
	return $args;
});
// send xml as POST variable "xml" ( Pro version)
add_filter('wc_order_export_http_args', function ($args) {
	$args['body'] = http_build_query( array("xml"=>$args['body']) ); 
	return $args;
});
// parse and save HTTP reply ( Pro version)
add_filter('woe_export_http_response', function ($response) {
 $parts = explode(",", $response['body'] ); // we get reply as plan text - "Tracking Number, Amount"
 update_post_meta( WC_Order_Export_Engine::$order_id, "tracking_number", $parts[0]);
 update_post_meta( WC_Order_Export_Engine::$order_id, "tracking_price", $parts[1]);
 return $response;
});
// Status Change job sends GET request , default action won't work 
add_filter("woe_export_http_custom_action", function($response, $url, $args) {
    $order = new WC_Order(WC_Order_Export_Engine::$order_id);

    //make vars here
    $vars = array();
    $vars['key'] = "secretkey";
    $vars['id'] = $order->get_id();
    $vars['recipient'] = $order->get_shipping_first_name() . " " . $order->get_shipping_last_name();
    $vars['company'] = $order->get_shipping_company();
    $vars['street'] = $order->get_shipping_address_1();
    $vars['city'] = $order->get_shipping_city();
    $vars['state'] = $order->get_shipping_state();
    $vars['countrycode'] = $order->get_shipping_country();
    $vars['zipcode'] = $order->get_shipping_postcode();
    $vars['phone'] = $order->get_billing_phone();

    //send 
    $url .= "?" . http_build_query($vars);
    $response = wp_remote_get($url, $args);
    return $response;
},10,3);

Actions after export

// Update order status with comment
add_action('woe_order_exported', function ($order_id) {
    $order = new WC_Order($order_id);
    $order->update_status('completed', 'Exported !');
} ); 

Alter summary report

//sort by sku
add_action('woe_summary_before_output' , function() {
  uasort($_SESSION['woe_summary_products'], function($a,$b) {
	if( empty($a['sku']) AND empty($b['sku']) )
		return 0;
	if( empty($a['sku']) )
		return 1;
	if( empty($b['sku']) )
		return -1;
	return strcmp($a['sku'],$b['sku']);
  });
});
// Add column "Total Orders" to "Summary by products"
class WOE_Total_Orders_Summary{
	function __construct() {
		add_filter('woe_summary_headers',function ($headers) {
			$headers[] = "Total Orders"; // just text 
			return $headers;
		});
		add_filter('woe_summary_column_keys',function ($cols) {
			$cols['count'] = 0; // new key with default value
			return $cols;
		});
		add_action('woe_summary_products_add_item',function ($key, $item, $order) {
			$_SESSION['woe_summary_products'][$key]['count'] ++; // add 1 for each order 
		},10,3);
	}	
}
new WOE_Total_Orders_Summary();

Sample addons

This section for programmers who put the changes in separate plugins. Please, review and use them as start point.
They don’t require pro version
Custom JSON format
Custom XML format
Custom CSV format

Columns for each currency

Download the plugin
This plugin was originally coded for https://classiccarbs.co.uk. They courtesy allowed to publish it for public use.

Export Sales/Taxes report

Download the plugin
You should create “Scheduled Job” and set it run “On the 1st day of the month” (Pro version only).
The custom plugin was requested by Jason Winter, WinternetWeb Technologies, LLC (www.WinternetWeb.com)

Sort by product names

// Sort by column "Item Name"
// Format PDF
// option "Fill order columns for" = ALL rows
class WOE_PDF_Sort{

	function __construct() {
		add_action("woe_settings_above_buttons", array($this,"draw_options") );
		// start SESSION
		add_filter("woe_settings_validate_defaults", function($settings) {
			if( !empty($settings[ 'sort_by_products' ]) ) {
				add_action("woe_pdf_started",array($this,"rebuild_pdf_file"),10,2);
			}
			return $settings;
		});
	}	
 
	// 1
	function draw_options($settings) {
		$selected = !empty($settings[ 'sort_by_products' ]) ? 'checked': '';
		echo '<input type=hidden name="settings[sort_by_products]" value="0">
		<input type=checkbox name="settings[sort_by_products]" value="1" '. $selected .'>
		<span class="wc-oe-header">Sort by products by field "Item Name",  Format PDF</span>';
	}
	
	//2
	function rebuild_pdf_file($pdf, $formatter){
		//read 
		$file = fopen($formatter->filename, 'r');
		$keys = fgetcsv($file);
		$rows = array();
		while ($val = fgetcsv($file))
			$rows[] = array_combine($keys, $val);
		fclose($file);

		//sort 
		usort ($rows, function ($a, $b) {
			return strcmp($a['Item Name'],$b['Item Name']);   // edit this line!
		});

		//write back
		$file = fopen($formatter->filename, 'w');
		fputcsv($file,$keys);
		foreach($rows as $row)
			fputcsv($file,$row);
		fclose($file);
	}
}

new WOE_PDF_Sort();
// Sort by product name
// Format XLS
// option "Fill order columns for" = ALL rows
class Woe_Sort_By_Product_Name {
	function __construct() {
		//add settings
		add_action("woe_settings_above_buttons", array($this,"draw_options") );
		
		// start SESSION
		add_filter("woe_settings_validate_defaults", function($settings) {
			if( !empty($settings[ 'sort_by_products' ]) ) {
				@session_start();
				
				//stop default output for rows
				add_action("woe_xls_header_filter",array($this,"init_session_data"),10,2);
				add_action("woe_xls_output_filter",array($this,"record_xls_rows"),10,2);
				add_action("woe_xls_print_footer",array($this,"sort_rows"),10,2);
			}	
			return $settings;
		});
		
	}

	// 1
	function draw_options($settings){
		$selected = !empty($settings[ 'sort_by_products' ]) ? 'checked': '';
		echo '<input type=hidden name="settings[sort_by_products]" value="0">
		<input type=checkbox name="settings[sort_by_products]" value="1" '. $selected .'>
		<span class="wc-oe-header">Sort by products,  Format XLS</span>';
	}
		
	// 2 init storage
	function init_session_data($data) {
		$_SESSION['woe_temp_rows'] = array();
		return $data;
	}

	//3 down't export rows 
	function record_xls_rows($data,$obj) {
		$_SESSION['woe_temp_rows'][] = $data;
		return false;
	}
	//4 sort and print 
	function sort_rows($phpExcel,$formatter) {
		usort($_SESSION['woe_temp_rows'], function($a,$b) {
			return $a['plain_products_name'] < $b['plain_products_name'] ? -1: 1; }); foreach($_SESSION['woe_temp_rows'] as $pos=>$data)
			$this->output_modified_xls($formatter,$data,$pos+2);
	}
	
	function output_modified_xls($formatter,$rec,$row) {
		$pos = 0;
		foreach ( $rec as $field => $text ) {
			$formatter->objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow( $pos, $row, $text );
			$pos++;
		}
	}
}
new Woe_Sort_By_Product_Name();

Export Products as columns

// Export Products as columns
// Format - XLS
// Checked - Output column titles as first line
// Button - Export w/o Progressbar
class Woe_Product_Columns {
    function __construct() {
        //add settings, , skip products        
        add_action("woe_settings_above_buttons", array($this,"draw_options") );
        add_filter("woe_settings_validate_defaults",array($this,"skip_products"),10,1);
    }

    // 1
    function draw_options($settings){
        $selected = !empty($settings[ 'products_as_columns' ]) ? 'checked': '';
        echo '<br><br>
        <input type=hidden name="settings[products_as_columns]" value="0">
        <input type=checkbox name="settings[products_as_columns]" value="1" '. $selected .'>
        <span class="wc-oe-header">Export products as columns,  print <select name="settings[products_as_columns_output_field]" style="width: 100px">
			<option value="qty">Qty</option>
			<option value="line_total">Amount</option>
        </select>
         in cell</span><br>
         Format <b>XLS</b>, button <b>Export w/o progressbar</b>
        <br><br>';
    }

    function skip_products($current_job_settings) {
        if( !empty($current_job_settings['products_as_columns']) )  {
             $current_job_settings["order_fields"]["products"]["checked"] = 0;//  just  skip standard products
             $this->output_field = $current_job_settings['products_as_columns_output_field'];
             // read orders
             add_action("woe_order_export_started",array($this,"start_new_order"),10,1);

             //stop default output for rows
             add_action("woe_xls_header_filter",array($this,"prepare_xls_vars"),10,2);
             add_action("woe_xls_output_filter",array($this,"record_xls_rows"),10,2);
             add_action("woe_xls_print_footer",array($this,"analyze_products_add_columns"),10,2);
        }
        return $current_job_settings;
    }   

    // 2
    function prepare_xls_vars($data) {
	$this->headers_added = count($data);
        $this->product_columns = array();
        return $data;
    }

    //3
    function start_new_order($order_id) {
        $this->order_id = $order_id;
        return $order_id;
    }
    function record_xls_rows($data,$obj) {
        $order = new WC_Order($this->order_id);
        $extra_cells = array_fill(0, count($this->product_columns), "");
        // work with products
        foreach($order->get_items('line_item') as $item_id=>$item) {
            $product_name = $item['name'];   
            $pos = array_search($product_name,$this->product_columns);
            if( $pos === false) { // new product detected
                $extra_cells[] = $item[ $this->output_field  ]; 
                $this->product_columns[] = $product_name;
            } else {
                $extra_cells[$pos] = $item[ $this->output_field  ]; 
            }
        }
        foreach($extra_cells as $pc)
            $data[] = $pc;
        return $data;
    }

    //4 
    function analyze_products_add_columns($phpExcel,$formatter) {
        // add products as titles
        foreach($this->product_columns as $pos=>$text)
            $formatter->objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow( $pos+$this->headers_added, 1, $text );
        //make first bold
        $last_column = $formatter->objPHPExcel->getActiveSheet()->getHighestDataColumn();
        $formatter->objPHPExcel->getActiveSheet()->getStyle( "A1:" . $last_column . "1" )->getFont()->setBold( true );
    }
}
new Woe_Product_Columns();
// Pro version, send separate CSV to each seller
class Woe_Seller_CSV_mod {
	function __construct() {
		add_action("woe_test_destination", array($this,"add_hooks") );
		add_action("woe_start_cron_job_1", array($this,"add_hooks") ); // adjust job ID here 
	}
	
	function add_hooks () {
		add_action("woe_formatter_csv_start", array($this,"csv_start"),10,1);
		add_action("woe_order_export_started",array($this,"start_new_order"),10,1);
		add_action("woe_get_order_product",array($this,"detect_seller"),10,1);
		add_action("woe_formatter_set_handler_for_csv_row",array($this,"switch_file"),10,1);
		add_action("woe_formatter_csv_finished",array($this,"close_csv_files"),10,1);
		add_action("woe_custom_export_to_email",array($this,"send_csv_files"),10,4);
	}

	function csv_start($header) {
		$this->header = $header;
		$this->filenames = $this->files = array();
	}

	function start_new_order($order_id) {
		//remember sellers is for rows here 
		$this->product_sellers = array();
		$this->product_sellers_pos = 0;
                return $order_id;
	}

	function detect_seller($product) {
		$seller_id = $product->post->post_author;
		
		// remember seller  sequence for rows
		$this->product_sellers[] = $seller_id; 
		
		//put header to new file
		if( !isset($this->files[$seller_id]) ) {
			$this->filenames[$seller_id] = tempnam("/tmp",$seller_id);
			$this->files[$seller_id] = fopen( $this->filenames[$seller_id], "wb+");
			fputcsv($this->files[$seller_id], $this->header);
		}
	}

	function switch_file($handle) {
		$seller_id = $this->product_sellers[$this->product_sellers_pos++];
		return $this->files[$seller_id];
	}
	
	function close_csv_files() {
		foreach($this->files as $f)
			if(get_resource_type($f) == 'stream')
				fclose($f);
	}
	
	function send_csv_files($processed, $filename, $filepath, $exporter) {
		global $ts_mail_errors;
		
		foreach($this->filenames as $seller_id => $filepath) { // override filepath
			$user_info = get_userdata($seller_id);
			if( !empty($user_info->user_email) ) {
				$exporter->destination['email_recipients'] = $user_info->user_email;//override email
				$ts_mail_errors = array();
				echo $exporter->run_export( $filename, $filepath )."\n";
			}	
		}
		return true;
	}
}
new Woe_Seller_CSV_mod();