In early 2008 when I started working in WordPress/WooCommerce I hardly know StackOverflow and WooCommerce API, so I had to write several API for some of our web service. Then I had written this function to get order details by order/post ID. Hope this function will be helpful for you as well.
3.x or above
2.6.x or below
Okay now, how do I use it?
getOrderDetailById() to your active theme
functions.php or to any active plugin PHP file.
getOrderDetailById() from anywhere in your app by passing the Order ID like below.
Using WooCommerce Shipment Tracking and want’s to add that as well?
WooCommerce Shipment Tracking is an awesome paid plugin that you must have! If you want to add this in your custom order detail function then just add below code in above mentions.