title: Show Woocommerce order details on custom thank you page
body: <p>Hi I created custom thank you page for my COD (cash on delivery) payment option. Redirect code below working.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>add_action( 'template_redirect', 'thankyou_custom_payment_redirect');
      function thankyou_custom_payment_redirect(){
      if ( is_wc_endpoint_url( 'order-received' ) ) {
          global $wp;
  
          // Get the order ID
          $order_id =  intval( str_replace( 'checkout/order-received/', '', $wp-&gt;request ) );
  
          // Get an instance of the WC_Order object
          $order = wc_get_order( $order_id );
  
          // Set HERE your Payment Gateway ID
          if( $order-&gt;get_payment_method() == 'cod' ){
  
              // Set HERE your custom URL path
              wp_redirect( home_url( '/custom-page/' ) );
              exit(); // always exit
          }
      }
  }</code></pre>
  </div>
  </div>
  
  Now in my <code>/custom-page/</code> I want to display same details as in Woocommerce <code>order-details.php</code>. I created <code>custom-page.php</code> with(<code>/* Template Name: COD Thank you page */</code>) for my Thank you Page, copied code from original Woocommerce <code>order-details.php</code> but just loads blank page. Can someone help me to do this correctly please.
  Thank you</p>