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.
1 2 3 4 5 6 7 | global $wpdb; $result = $wpdb->get_results('select t1.order_item_id, t2.* FROM wp_woocommerce_order_items as t1 JOIN wp_woocommerce_order_itemmeta as t2 ON t1.order_item_id = t2.order_item_id where t1.order_id='.$order->ID); echo '<pre>'; print_r($result); echo ' |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.