Is it possible to create custom column to print specific product with its quantity.
Order | Product1 | Product2 | ...
#1231 5 3
Yes, it's possible.
1st solution .
Use following code to show qty/costs
https://algolplus.com/plugins/code-samples/#complex_reports_products_columns
But this code adds ALL products in RANDOM order.
2nd solution.
If you have to export only some products(or want to show new columns at any position) use this way
1. Open section "Setup fields" and use button "Add Field" to add each product .
Don't forget to drag added field to left column!
2. Open section "Misc Settings", mark "Custom PHP code" and add following code.
add_filter( "woe_fetch_order", function($row, $order ){ foreach($order->get_items() as $item) { $key = $item['name']; if( isset($row[$key])) $row[$key] = $item['qty']; } return $row; },10,2);