I want to get the meta data (_wcj_purchase_price) of products from the complete orders since one month.
I try with MYSQL and WP_Query, but I qickly lost with that.
Actually, I have the meta_value for the product :
SELECT post_id as order_id, meta_key, meta_value from wp_postmeta where post_id in
( SELECT ID FROM
wp_posts
WHERE post_type = 'shop_order' and post_date BETWEEN NOW() - INTERVAL 30 DAY AND NOW()
)
and meta_key = '_wcj_purchase_price'
But I don't know to get this value for each product ordered.