title: Display a custom field in woocommerce_review_order_before_submit
body: <p>I have a custom checkout field that I created using the following code:</p>
  
  <pre><code>add_action( 'woocommerce_before_order_notes', 'add_custom_checkout_field' );
  function add_custom_checkout_field( $checkout ){
    woocommerce_form_field( 'number_id', array(        
      'type' =&gt; 'number',        
      'class' =&gt; array( 'form-row-wide' ),        
      'label' =&gt; 'Amount',        
      'placeholder' =&gt; 'Place your number here',        
      'required' =&gt; false,              
     ),  $checkout-&gt;get_value( 'number_id' ) ); 
  }
  </code></pre>
  
  <p>I want this field to be displayed in the space before the place order button. I tried doing the following but it didn't work:</p>
  
  <pre class="lang-php prettyprint-override"><code>    add_action( 'woocommerce_review_order_before_submit', 'review_order_before_submit_state_message' );
      function review_order_before_submit_state_message() {
          $amount = WC()-&gt;session-&gt;get('number_id');
          $message = "Amount you entered is: &lt;strong&gt;".$amount;
              echo '&lt;ul class="woocommerce-info"&gt;'.$message.'&lt;/ul&gt;';
      }
  </code></pre>
  
  <p>This amount can also change depending on customer's input so tried javascript too but the cart doesn't refresh:</p>
  
  <pre><code>add_action( 'wp_footer', 'bbloomer_checkout_radio_choice_refresh' );
  
  function bbloomer_checkout_radio_choice_refresh() {
  if ( ! is_checkout() ) return;
  ?&gt;
  &lt;script type="text/javascript"&gt;
  jQuery( function($){
      $('form.checkout').on('change', 'input[name=number_id]', function(e){
          e.preventDefault();
          var p = $(this).val();
          $.ajax({
              type: 'POST',
              url: wc_checkout_params.ajax_url,
              data: {
                  'action': 'woo_get_ajax_data',
                  'radio': p,
              },
              success: function (result) {
                  $('body').trigger('update_checkout');
              }
          });
      });
  });
  &lt;/script&gt;
  &lt;?php
  }
  // WP Ajax Function
  add_action( 'wp_ajax_woo_get_ajax_data', 'woo_get_ajax_data' ); 
  add_action( 'wp_ajax_nopriv_woo_get_ajax_data', 'woo_get_ajax_data' ); 
  function woo_get_ajax_data() { 
      if ( isset($_POST['number_id']) ){ 
          $number_id = sanitize_key( $_POST['number_id'] ); 
          WC()-&gt;session-&gt;set('number_id', $number_id ); 
          echo json_encode( $number_id ); 
      } 
      die(); 
  } 
  </code></pre>
  
  <p>Can anyone tell me what am I doing wrong? Thank you.</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>add_action( 'wp_ajax_woo_get_ajax_data', 'woo_get_ajax_data' ); 
  add_action( 'wp_ajax_nopriv_woo_get_ajax_data', 'woo_get_ajax_data' ); 
  function woo_get_ajax_data() { 
  if ( isset($_POST['number_id']) ){ 
  $number_id = sanitize_key( $_POST['number_id'] ); 
  WC()-&gt;session-&gt;set('number_id', $number_id ); 
  echo json_encode( $number_id ); 
  } 
  die(); 
  }
  </code></pre>