Although Easy Digital Downloads shows the total spent for each customer under Downloads → Reports → Customers, there’s no way for a customer themselves to see how much they have spent.
The following code will allow you to show a logged in customer how much they’ve spent, anywhere on your website. You could show this on the customer’s purchase history page, or add it to a purchase history dashboard widget.
Copy and paste the following function (mind the opening PHP tag) into your child theme’s functions.php or custom plugin:
Then, you can simply call <?php echo sumobi_edd_get_total_spent_for_customer(); ?>
Alternatively, if you need to show only a specific customer’s total spent, you can pass a user ID into the function like this:
<?php echo sumobi_edd_get_total_spent_for_customer( 50 ); ?>