• Hi! Quick question. Is it possible to somehow define the decimal precision of the exported data? I have set woocommerce to round to two decimal digits since more aren’t customer friendly to read. But in the exported date ideally I would like the numbers (like the tax) to have six or more decimal places. Is this possible with your plugin? Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    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://www.ads-software.com/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?

    Plugin Author algol.plus

    (@algolplus)

    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?

    Plugin Author algol.plus

    (@algolplus)

    hi

    I think, yes.

    but you should review database, table “woocommerce_order_itemmeta” , records having “meta_key” = “tax_amount”.

    thanks, Alex

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Setting decimal precision?’ is closed to new replies.