I'm using wordpress and woocommerce on a site where I have users create accounts so that they can upload their own clothing designs, I then sell these products and for each sale of their design the specific user gets a cut of the sale. I am trying to show the number of sales for each user on my site but can't figure out how to. I just need to be able to call the products created by each user specifically and then get the total sales from each of those products, then combine them into a total sales number for each individual user... can anyone point me in the right direction??
I am able to get the total sales for a single product using the
<?php echo get_post_meta($post->ID, 'total_sales', true); ?>
but I have no idea how to get it for a specific for a user.
<?php echo wc_get_customer_total_spent($user_id); ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With