title: How to get wooCommerce Order id
body: <p>I am trying to get wooCommerce order id. I wrote the following script in functions.php but i getting 0.Can you tell how to get the Id.</p>
  <pre><code>global $woocommerce, $post;
    $order = new WC_Order($post-&gt;ID);
    $order_id=$order-&gt;get_id();
  </code></pre>