title: How to get Order key for creating custom order return url in WooCommerce
body: <p>This is the code that I am using to get a custom Order return URL: </p>
  
  <pre><code>global $woocommerce;
  $test_order = new WC_Order($order_id);
  $test_order_key = $test_order-&gt;order_key;
  $returnURL = site_url().'/checkout/order-received/7140/'.$test_order_key;
  </code></pre>
  
  <p>The example URL that I need is: <br><code>http://www.example.com/checkout/order-received/[order_number]/key=[wc-order-key]</code></p>
  
  <p>How do I get <strong><code>[wc-order-key]</code></strong>?</p>
  
  <p>Thanks.</p>