• Hi,

    the plugin has a rounding error in the total amount.
    For example the total amount must be 300,00€ but on the invoice is 299,99€
    How can I fix it?

    I use the newest update of this plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Teresa,
    I’m sorry to hear you’re seeing rounding errors.
    Could you post a screenshot of the order data (upload to dropbox or to a site like imgur.com)? Our plugin doesn’t actually make any calculations for the grand total, that is all handled by WooCommerce.

    I found the same issue a couple of months ago and thought it was connected to the WooCommerce Product Bundles plugin. However, the support for that plugin did a lot of checking and stated…

    “it is possible that the sum of all the individual order items is not equal to the total order price, regardless of the order items product type. The reason why this happens is that WooCommerce core uses different methods to calculate the total order price than to display item subtotals — the former are more extensive and calculate totals with better accuracy”

    I tested buying the same products but not via a product bundle and got the same issue so I know it’s not that plugin.

    It appears that this plugin uses the Woocommerce subtotals which is where the issue lies. If you check the order confirmation page that appears after a customer has made an order you will see the same issue with the figures on that page. This plugin just reproduces those figures I believe.

    A simple solution for this plugin would be to take the actual Woocommerce total and then reduce by the postage cost to get the subtotal – that way all the figures would tie up and from my testing I believe they would be correct (as the actual total is always correct). It’s not ideal as the woocommerce order confirmation page would still be wrong but the long term record is the pdf produced by this plugin: I doubt many customers bother reading the order confirmation page in any detail so hopefully won’t notice. Woocommerce should look to correct it though.

    I can supply screen prints if needed,

    Terry

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Terry,
    As you and Product Bundles support already concluded, this is an issue primarily with WooCommerce itself. I think the rounding errors are caused by the specific tax entries in the products and shipping in combination with the tax rounding settings you have applied in WooCommerce.

    Unfortunately we cannot implement the change you propose as any custom calculation introduces potential errors, especially considering the fact that this plugin is used in a wide variety of environments and there can be other cost factors besides shipping. The discrepancy between information that the user receives via email, in the thank you page and their account versus what is in the PDF is also not something we want to introduce into the plugin. Assuming customers won’t read all those things and will only open the PDF is wishful thinking ??
    I would like to help in this issue, but I hope you understand we are limited to what WooCommerce actually records in the order data.

    That said, your best bet is contacting WooCommerce and ask them to fix this or tell you which tax rounding settings you should use to have totals that add up correctly.

    Good luck!

    Hi Ewout

    I wouldn’t know where to start with that but I will add it to my to-do list.

    In the meantime is there anyway I can change my local version of the plugin so it does not show the subtotal of products and just shows each product, the shipping and the grand total?

    Thanks

    Terry

    Plugin Contributor Ewout

    (@pomegranate)

    You could remove the subtotal from WooCommerce and this will remove it from the invoice too. That will require a small code snippet though:

    
    add_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' );
    
    function adjust_woocommerce_get_order_item_totals( $totals ) {
      unset($totals['cart_subtotal']  );
      return $totals;
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘rounding error in total amount’ is closed to new replies.