I am having trouble with Woocommerce product details and order details relationship. I’m not able to find the product ID of a related order ID on the View Orders page of the Woocommerce theme. I simply want to get the product content and permalink etc on View Orders page.
I tried searching in wp_postmeta
but had no luck.
WooCommerce 3.0+
you can get the order items of an order by
then if you loop through the items, you can get all the relevant data:
a good tip is to check how the admin order pages get the data, you’ll find many answers there!
Pre-WooCommerce 3.0
I worked on it and achieved something. That I would like to share to other developers. This is not preferred way to do it, but for knowledge I am posting my answer.
hope will help someone.
Additionally:
Better to use wordpress table prefix to avoid problems in multiple website or in migration etc.