title: Localize variables on AJAX call in WordPress
body: <p>I am trying to localize the variables on <code>update_order_review</code> ajax call. There is no error but still not able to locate in DOM to access. </p>
  
  <p>I have made it work with setting a cookie and accessing from JS which is not worth.</p>
  
  <p>Scenario:</p>
  
  <pre><code>add_action( 'woocommerce_checkout_update_order_review', array( $this, 'some_process' ) );
  
  function some_process() {
      do_action('some_action');   
  }
  
  add_action('some_action', function($obj) {
      wp_localize_script('jquery', 'ajax_custom', array(
              'ajaxurl' =&gt; admin_url('admin-ajax.php')
          ));
      });
  }
  </code></pre>
  
  <p>I am trying to fetch the currently added product on js end and current cart object JSON.</p>