• Resolved booklysql

    (@booklysql)


    Hello

    At first I thought that I have quite an easy task to complete, but as it turned out, still too difficult. Maybe somebody can help:

    I need to create query in phpMyAdmin that gives me a following result:
    Show products that are in orders (all states) list by category. Like if I insert category “cars” then i see a result of orders that has category as cars.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. WooCommerce FB group: https://www.facebook.com/groups/advanced.woocommerce/
    Thread Starter booklysql

    (@booklysql)

    Now I have had some progress, I can get object_ID from orders list, searching by category. Now I need additional data:
    order number; Object_ID; object name; description; rented from date; rented to date; order status; client name; client aadress

    I would really appreciate if someone could help me ??

    MySQL ia have now:

    SELECT DISTINCT tr.object_id
    FROM iqpe_term_relationships tr
    INNER JOIN iqpe_term_taxonomy tt
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    INNER JOIN iqpe_terms t
    ON tt.term_id = t.term_id
    INNER JOIN iqpe_woocommerce_order_itemmeta oim
    ON tr.object_id = oim.meta_value
    INNER JOIN iqpe_woocommerce_order_items oi
    ON oim.order_item_id = oi.order_item_id
    INNER JOIN iqpe_posts as o
    ON oi.order_id = o.ID
    WHERE tt.taxonomy = ‘product_cat’
    AND t.slug = ‘jaana-ou’
    AND oim.meta_key = ‘_product_id’
    AND o.post_type = ‘shop_order’
    AND o.post_status IN (‘wc-completed’,’wc-processing’)

    • This reply was modified 4 years, 8 months ago by booklysql.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘data from wp/woocommerce database’ is closed to new replies.