see my comments inside!
// All products in one cell as
// Product Quantity: x, Product SKU: x, Product Name: x, Product Variation: x, Product Size: x, Product Unit Price: x, Product Total Price: x | another item...
add_filter('woe_get_order_product_fields', function ($fields,$format) {
$fields['all_in_one'] = array( 'label' => 'All products in one cell', 'colname' => 'All products in one cell', 'checked' => 1 );
return $fields;
}, 10, 2);
add_filter('woe_fetch_order_products', function ($products, $order, $labels, $format, $static_vals) {
$lines = array();
foreach ( $order->get_items('line_item') as $item_id=>$item ) {
$product = $order->get_product_from_item( $item );
$product = apply_filters( "woe_get_order_product", $product );
$item_meta = get_metadata( 'order_item', $item_id );
$l = array();
$l[]= 'Product Quantity: '.$item['qty'];
$l[]= 'Product SKU: '.$product->sku;
$l[]= 'Product Name: '.$item['name'];
$l[]= 'Product Variation: '.$item['Color']; // adjust this line
$l[]= 'Product Size: '.$item['Size'];// adjust this line
$l[]= 'Product Unit Price: '.wc_format_decimal($order->get_item_total( $item, false, true ), 2) ;
$l[]= 'Product Total Price: '.wc_format_decimal($item['subtotal'],2);
$lines[]= join(",",$l);
}
$item = array('all_in_one'=>join(" | ",$lines));
return array($item);
}, 10, 5);