wc_get_customer_total_spent issue
-
Hello there,
I would like to show in the my account page for the users the total amount of money spent in all orders. For that I use the woocommerce function wc_get_customer_total_spent and insert it in the my-orders.php file like this:
<?php echo wc_get_customer_total_spent( get_current_user_id() );?>The problem is that the amount returned is wrong, the decimals are not summed up and only show the decimals from the last order. Example:
A user have to orders, first total 10.35$ and second 10.11$ the function returns 20.11$. I have tested in many users and always the same issue, it only shows the decimals from the last order not summing up any of the previous decimals.
Is anyone finding the same issue?.
Thanks.
- The topic ‘wc_get_customer_total_spent issue’ is closed to new replies.