I am searching around but is it possible in Woocommerce to show a list of users that has bought the product in the frontend?
So on the product page i wanna show a list of users that also has bought that product.
I am searching around but is it possible in Woocommerce to show a list of users that has bought the product in the frontend?
So on the product page i wanna show a list of users that also has bought that product.
2
Answers
Oke i have fixed it with a little help of this question.
So what i do i put this in a function:
and then i use this to display their "display name" and a link to the profile:
Not sure if your users would appreciate this, but I believe that that WooCommerce offers a hook to fetch orders.
$orders->get_items();
You could loop through this and get the user() information. Obviously you would need to make sure that information that isn’t "personal", so no email etc. and only the first name for example.
Check this out:
https://www.businessbloomer.com/woocommerce-easily-get-order-info-total-items-etc-from-order-object/