Show user’s purchase history as a dashboard widget

By default, when a user registers via the checkout, they are automatically logged in and can access the WordPress’ dashboard as a subscriber. This snippet adds a customer’s purchase history as a dashboard widget.

Copy and paste the following functions (mind the opening PHP tag) into your child theme’s functions.php or custom plugin.

5 thoughts on “Show user’s purchase history as a dashboard widget”

  1. Thanks so much for sharing this Andrew! It’s very practical. I was wondering how we can show the total amount purchased by the user at the bottom of this widget.

Leave a Reply

Your email address will not be published. Required fields are marked *