Support » Plugin: WooCommerce » Shipping taxes are recalculated after changing order status

  • nzecheru


    I have an issue with the shipping tax calculation. I add the shipping cost without tax, and everything is calculated OK in the cart/checkout page. Also, in back office, the order is displayed correctly (cost/taxes are calculated OK), as well in the confirmation emails.

    The problem happens when you change the order status to Complete (or any other status)- it will automatically change the shipping cost and the total cost – it adds 0.01.

    The shipping cost is 15 with tax included, so I have to configure it to 12.6050 (without tax) in order be calculated correctly: 15 lei.

    I think the issue is related with the number of decimals used – WooCommerce is set to 2 decimals. If I change the WooCommerce setting to use 4 decimals, it is OK, but the amounts look awful and are very confusing for customers.
    Also, when you edit an order, the tax for shipping has 4 decimals, not two decimals as the other products have.

    From accounting perspective, the shipping cost without tax should be 12.61 lei, and the shipping tax should be 2.39 lei (total shipping cost with tax included = 15 lei)

    I included some screenshots with the current settings (using Woocommerce 3.0.7)

    General OptionsTax OptionsTax Standard Rates
    Flat rate settingsCart totals displayed correctlyBack office totals are displayed correctly

    Now, changing the order status will automatically recalculate the shipping tax and will add 0.01:Shipping tax is recalculated when changing the order status.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nzecheru


    I have also posted this question on WordPress StackExchange and tried the solution recommended by hwl, but this doesn’t fix the issue.

    Any help or idea what I may try is greatly appreciated.


    @nzecheru any luck on this one? We have kinda the same thing. Just wanted to follow up if you found a fix.

    Thread Starter nzecheru


    @alexkappel Unfortunately no… I’m hiding the decimals on the front end (add this line in your functions.php file: add_filter( 'woocommerce_price_trim_zeros', '__return_true' );)
    I use woocommerce-pdf-invoice plugin. My current workaround is to use 4 decimals in order to calculate the shipping cost correctly. To display amounts with 2 decimals in the invoice, I changed the woo-pdf-invoice.class.php and hardcoded the number of decimals to 2: //$decimals = is_null($decimals) ? and changed it to $decimals = ‘2’; This way the price is displayed correctly with 2 decimals (only the tax is displayed with 4 decimals)

    I also tried to find an answer on wordpress.stackexchange, you can check the answers I got <a
    BTW, I tried on two fresh wordpress/woocommerce installation and the behavior is exactly the same (initially I thought there was something I did/installed etc. which affected the functionality)

    I hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shipping taxes are recalculated after changing order status’ is closed to new replies.