hi
You should remove “format” for these columns.
please, try following code
add_filter('woe_get_order_fields', function ($fields) {
unset($fields["order_total_tax"]["format"]);
return $fields;
});
add_filter('woe_get_order_product_fields', function ($fields) {
unset($fields["line_tax"]["format"]);
return $fields;
});
use https://ww.wp.xz.cn/plugins/code-snippets/ or modify functions.php
thanks, Alex
Thread Starter
evmapa
(@evmapa)
Hi Alex, thank you so much for your time and help!
Unfortunately the code doesn’t appear to change anything :(. Does woocommerce maybe only save the already rounded taxes? I hope not!
I have already used your code “//add all taxes as columns” you posted on your website and it works great. Is it possible to get these tax fields with the full tax amount and not the rounded one?
hi
you should replace
$this->taxes['tax_'.$tax->rate_id ] = wc_round_tax_total($tax->amount);
with
$this->taxes['tax_'.$tax->rate_id ] = $tax->amount;
thanks, Alex
Thread Starter
evmapa
(@evmapa)
Hi Alex,
thanks again for your help! At first glance your code totally works, but as it turns out, the numbers after the second decimal digit are wrong.
For example: A order total is 12.70 incl. 10% tax. This means tax is 1,154545454545455
but the export says tax is 1,159091.
Do you think this is a woocommerce problem?
hi
I think, yes.
but you should review database, table “woocommerce_order_itemmeta” , records having “meta_key” = “tax_amount”.
thanks, Alex