title: WooCommerce ajax fetch order status
body: <p>My WooCommerce store will be updating the order status within a few minutes to a number of different states. Similar to how online pizza trackers work e.g. in the oven > baking > checking > delivering. </p>
  
  <p>I'm currently displaying my order status on the thank you page - </p>
  
  <pre><code>&lt;h3 class="order-status"&gt;&lt;?php echo $order-&gt;status; ?&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>But I want to use ajax and possibly a jQuery set time out to update the status every 10 seconds. </p>
  
  <pre><code>setTimeout(fetchStatus, 10000);
  </code></pre>
  
  <p>I'm not sure what call to make will I have to create a function that uses the <code>global $wooCommerce</code> variable and keep updating it that way?</p>
  
  <p>To confirm this is on a custom woocommerce thankyou page template.</p>