• Resolved chchch

    (@goch)


    I seems that the setting “number of decimals” affects the rounding of the tax :

    – If I have 2 decimals, create an order A, and look at it, then everything is fine : https://ibb.co/k40Xs2V

    – If I switch to 0 decimals and create a new order B, then I can see that tax is rounded if I look at it (that’s also expected) : https://ibb.co/C6HbwX0

    But if I now switch back to 2 decimals and look again at that previous order B, I see that the tax value stays rounded there (not in the first line, but in the main table): https://ibb.co/yV0q9dY

    This is easy to reproduce.
    So it seems that woocommerce’s decimals setting affects some stored tax amount and not only the displayed one?

    However, as woocommerce only has a wrong vat in the main table but still shows the correct amount of tax on the first line (cf latest screenshot) then the correct tax amount must still stored correctly somewhere? If so why not always use that one?
    How can I get it in php?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter chchch

    (@goch)

    Hi,

    do you confirm the bug?
    this is quite an important one. other plugins are using that (wrong) vat saved value.

    thanks,
    Charles

    • This reply was modified 3 years, 1 month ago by chchch.
    Mirko P.

    (@rainfallnixfig)

    Hey @goch,

    I followed exactly the same steps you mentioned and was not able to replicate the issue on my test site running only WooCommerce and Storefront theme.

    When I switch back to 2 decimals after having changed to 0 decimals and refresh the page all is back to normal:


    Link to image: https://snipboard.io/lPV92u.jpg


    Link to image: https://snipboard.io/e8m5fd.jpg

    Typically, issues like these are caused by a conflicting plugin or theme installed on the site.

    In order to troubleshoot this further would you mind taking the following steps?

    1. Temporarily switch to one of our default themes, such as Storefront (https://woocommerce.com/storefront/) to ensure that this isn’t a theme compatibility issue. Once you switch themes, can you check and see if everything functions as expected?

    2. If not, we also recommend deactivating all plugins except for WooCommerce to see if this resolves the issue at that point. If it does, then you would need to activate each plugin, one at a time, to see if you can find the conflicting extension/plugin.

    For a full guide on conflict testing, please see:

    https://docs.woocommerce.com/document/woocommerce-self-service-guide/

    Cheers.

    Thread Starter chchch

    (@goch)

    Hi Mirko,

    Thanks for your reply.

    Looking at your images it seems to me that you are looking at the checkout page instead of looking at a confirmed order.

    Please read the information below carefully as I added new information, and rewrote the steps to reproduce in more detail.

    Steps to reproduce the bug:

    – use the theme “storeFront
    – activate only 2 plugins : woocommerce and WooCommerce Stripe Gateway (you can use another gateway if you want)

    – in the woocommerce general settings:
    . enable tax rate and calculation
    . set the number of decimals to 0

    – in the TAX settings:
    . enable Yes, I will enter prices inclusive of tax
    . DO NOT check “Round tax at subtotal level, instead of rounding per line”

    – set your payment in test mode
    – go to the shop, and purchase something with some taxes.
    do all the checkout process until the end, up to the “Order received” confirmation

    – on the backend, go to woocommerce->orders and select the order you just did to see the details.
    Here is what I have : https://ibb.co/ySKXWZX

    as you can see, everything (prices/taxes) is rounded. all good.

    – go back to the general settings, and set the number of decimals to 2

    – refresh the oder page you were looking at previously. I have that : https://ibb.co/K9xWjPG

    as you can see the vat is not correctly updated, it is still rounded. this is a bug. woocommerce has stored the order total taxes as rounded.

    Charles

    Mirko P.

    (@rainfallnixfig)

    Hey there,

    Thank you for the detailed post with replication instructions. For bugs, you may want to open up an issue at GitHub. The developers use it to check issues like this one. You can open up a new bug report here:

    https://github.com/woocommerce/woocommerce/issues/new/choose

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘0 decimals and saved tax amount’ is closed to new replies.