Hello
How will you add it to order line ? Could you upload sample file to helpdesk ?
if you’re a programmer, you can modify example “export Shipping line as Product”
https://algolplus.com/plugins/code-samples/
You must replace $order->get_items(‘shipping’) with $order->get_items(‘fee’)
if you want to export only taxes , try example “add all taxes as columns”
I can’t help you until you provide sample file.
thanks, alex
I’ve tried modifying the sample codes, but I don’t think it’s quite what I’m looking for…
I have opened a ticket ‘#38’ in the HelpDesk and attached 2 images, showing asample of what I’d like to export.
It’s basically another the id of the field would be ‘order_fee_ine_items’ with class ‘fee’.
Thank you for detailed reply!
Could you try this code ?
add_filter('woe_get_order_fields', function ($fields) {
$fields['processing_fee'] = array( 'label' => 'Processing Fee', 'colname' => 'Processing Fee', 'checked' => 1 );
return $fields;
});
add_filter('woe_get_order_value_processing_fee', function ($value,$order) {
$fees = $order->get_items('fee');
if( !$fees )
return 0;
$fee = reset($fees); // take first
return $fee['line_total'];
},10, 2);
Excellent.
That code snippet did accomplish the task.
Thank you for your help, and enjoy your day.
This code was added to code samples
// new column "All Fees"
add_filter('woe_get_order_fields', function ($fields) {
$fields['all_fees'] = array( 'label' => 'All Fees', 'colname' => 'All Fees', 'checked' => 1 );
return $fields;
});
add_filter('woe_get_order_value_all_fees', function ($value,$order) {
$result = 0;
foreach($order->get_items('fee') as $fee) {
$result += $fee['line_total'];
}
return $result;
},10, 2);