Hi
Could you turn off “Populate other columns if products exported as rows” at tab “XLS”? or remove field “Products” from export ?
thanks, Alex
Hey!
If I turn off “Populate other columns if products exported as rows” the copied row is replaced with an empty row.
If I remove the field “Products” there are no doubled rows and no empty ones.
But obviously I need the Product field š
Greetings
-
This reply was modified 8 years, 2 months ago by
philipewert.
Could you open “setup fields” , go to Products and select “export as XX columns”?
It’s selected by default. Even “export as rows” did no change. :/
hi
Could you upload wrong file to helpdesk ?
thanks, Alex
I’m afraid that’s not possible, I’m very sorry.
But, is it possible, that we filter the blank rows just before the .xls Output?
That would have the same effect, but a bit “dirty” š
Greetings!
you can try add this code to section “Misc Settings”.
add_filter("woe_xls_output_filter",function($data,$formatter){
$t = join("",$data);
return empty($t) ? false : $data;
},10,2);
Okay it seems like I gave a false information. The empty rows are not totally empty, there is only the TAX, sorry!
But I switched some preferences and found out, that if I select “export as XX columns” and leave the “Number-Field” empty, the plugin creates me two column “Tax #1” and “Tax #2”. It seems like the problem is, that the plugin thinks, some products got different Tax-Values?
I mean, is it possible to display the Taxes for the whole order. Because the right now I display the Taxes through the “Products Field” right?
Greetings!
Do you see another fields with postfix “#2” ? or only Tax ?
No, only “Tax”.
Sometimes the right Tax is in the “Tax #1” Column, sometimes in “Tax #2″…
No. Only one code-sample in another Export-Profile.
Do you use “filter by products” in this profile ?
there is only one reason for duplicated rows — order has many products.
The only filter I’m using is “filter by order-status”.
Following code adds “order tax rate”, it takes tax rate from first item having tax!
// add field "order tax rate "
add_filter('woe_get_order_fields', function ($fields) {
$fields['tax_rate'] = array( 'label' => 'Tax rate', 'colname' => 'Tax rate', 'checked' => 1 );
return $fields;
});
// calculate new field
add_filter('woe_get_order_value_tax_rate', function ($value,$order, $field) {
foreach ( $order->get_items( 'line_item' ) as $item) {
if( $item['line_subtotal_tax']>0 ) { // take first tax!
return round( $item['line_subtotal_tax']/$item['line_subtotal']*100, 2);
}
}
return 0;
}, 10, 3);