When the user is logged in, you might want to show the list of products he has purchased, for example in a custom “My Account” tab.
A client required this, and so I decided to code this as a shortcode as well. Enjoy!
PHP Snippet: Display All Products Purchased by User – WooCommerce
And then use the shortcode where you need (it will only work when the user is logged in, so for example the My Account page would be ideal):
Where to add this code?
You can place PHP snippets at the bottom of your child theme functions.php file (and in case of CSS, this goes at the bottom of the style.css file) – if you need more guidance, please take a look at my free WooCommerce Customization video tutorial.
Did this snippet work?
Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise
And if you think this code saved you time & money, please join the other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance! Rodolfo