Is not there anybody to answer to me???
Hi @shdehnavi
When any product is purchased then we will have two reference _edd_download_earnings
and _edd_download_sales
which are stored in Product meta.
Please refer below reference WP_Query which will help you to achieve your task
https://gist.github.com/Pratik-Jain12/b4f39f934e08b1a1db164dc36f1b18c8
Thanks and i have seen the codes but there us an issue. those codes will query for **all** products have been saled but i need to query for products that a specfic user has saled. How can i query for that user?
Hi @shdehnavi
Sorry for my delay response.
Can you please elaborate it a little more so I can get your point and resolve your query?
Does you website has vendors and you want purchased products for vendors?
Hi @pratik-jain
yes. it is delay response.
yes my website has vendors and users. and i need to display:
1- products that every user has sold.
2- products that every user has purchased.
and display other details about those products. and i want to do it by WP_Query.
how can i do that?
-
This reply was modified 5 years ago by sh.dehnavi.
Hi @shdehnavi
For your query,
1) products that every user has sold.
– As you are using EDD vendor plugin (EDD FES) so you need to check in in your DB. Kindly check user meta table or product meta table. You can find any relevant info from it. I hope so. I dot not have that add-on so I unable to check.
2) products that every user has purchased.
– In this my previous meta key will work for you. When a product is sold then it will update it’s earning and update count in that relevant key. So you can find products that every user has purchased.