title: Get the custom field value in Woocommerce Edit Order pages custom metabox
body: <p><a href="https://i.stack.imgur.com/7nMhQ.jpg" rel="nofollow noreferrer">enter image description here</a>I am trying to display any value I place on the placeholder on a custom field at the admin area on the post, or an individual order page. </p>
  
  <p>I have already placed  <strong><code>get_post_meta( get_the_id(), 'total-usd', true )</code></strong> inside the quotes <strong><code>value=""</code></strong> so it should not be empty, but its still shows empty when I click update. </p>
  
  <p>What's seems to be wrong with my code? I appreciate your help on this.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  
  function cpmb_add_meta_box() {
  
      add_meta_box(
          'woocommerce-order-my-custom',
          'USD Currency display', 
          'cpmb_display_meta_box', 
          'shop_order',           
          'normal',               
          'core'
      );
  }
  add_action( 'add_meta_boxes', 'cpmb_add_meta_box');
  
  function cpmb_display_meta_box( $post ) {
  
      wp_nonce_field( plugin_basename( __POST__ ), 'cpmb-nonce-field' );
  
      $html = '&lt;label id="total-usd" for="total-usd"&gt;';
      $html .= '&lt;strong&gt;Total USD Currency&lt;/strong&gt;';
      $html .= '&lt;/label&gt;&lt;br /&gt;';
      $html .= '&lt;input type="text" id="total-usd" name="Total USD Currency" value="' . get_post_meta( get_the_id(), 'total-usd', true ) . '" placeholder="Enter Total here" /&gt;';
      echo $html;
  }
  
  function cpmb_save_meta_box_data( $post_id ) {
  
      if ( cpmb_user_can_save( $post_id, 'cpmb-nonce-field' ) ){
      if ( isset( $_POST['total-usd'] ) &amp;&amp; 0 &lt; count( strlen( trim($_POST['total-usd'] ))))  {
  
              $total_usd = stripslashes( strip_tags($_POST['total-usd']));
              update_post_meta( $post_id, 'total-usd', $total_usd );
          }
      }
  }
  add_action( 'save_post', 'cpmb_save_meta_box_data' );
  
  function cpmb_user_can_save( $post_id, $nonce ) {
  
      $is_autosave = wp_is_post_autosave( $post_id );
      $is_revision = wp_is_post_revision( $post_id );
      $is_valid_nonce = ( isset( $_POST[ $nonce ] ) &amp;&amp; wp_verify_nonce($_POST[ $nonce ], plugin_basename( __POST__ ) ) );
      return ! ( $is_autosave || $is_revision ) &amp;&amp; $is_valid_nonce;
  }
  
  ?&gt;
  </code></pre>