• Hi my friends. I need to display just those downloads the user has purchased and have a specific meta_key (Custom Field Parameters). so i have to use WP_Query but I do not know how to find those downloads the user has purchased by WP_Query (which meta key).
    I have two cindition:
    1- those downloads the user has purchased
    2- those downloads have specific meta_key

    How can i do that?

    • This topic was modified 5 years, 1 month ago by sh.dehnavi.
    • This topic was modified 5 years, 1 month ago by sh.dehnavi.
    • This topic was modified 5 years, 1 month ago by sh.dehnavi.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sh.dehnavi

    (@shdehnavi)

    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

    Thread Starter sh.dehnavi

    (@shdehnavi)

    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?

    Pratik Jain

    (@pratik-jain)

    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?

    Thread Starter sh.dehnavi

    (@shdehnavi)

    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.
    Pratik Jain

    (@pratik-jain)

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to get user’s purchases by WP_Query?’ is closed to new replies.