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.