title: AJAX cart update woocommerce
body: <p>How can I update cart content via AJAX after 'update cart' button click? </p>
  
  <p>When I'm trying to use <code>$fragments</code> function, it always returns true... I've tryied use woocommerce hooks but fields was not refreshing via AJAX. I realy need a little help, because I'm stuck. I've tried everything... I belive that can be done via "add_action". Help? :)</p>
  
  <pre><code>add_action('woocommerce_checkout_after_customer_details','inputs_after_cart');
  
  function inputs_after_cart($checkout) {
  
      global $woocommerce;
      $items = $woocommerce-&gt;cart-&gt;get_cart();
  
      $i = 1;
  
      foreach($items as $item =&gt; $values) { 
          $_product = $values['data']-&gt;post;
          $quantity = $values['quantity'];
          $x = 1;
  
          while ($x &lt;= $quantity) {
  
           echo '&lt;div class="col-12 refresh-tickets"&gt;&lt;h3&gt;' . $_product-&gt;post_title .  __(' - Bilet ' . $x . ' ') .'&lt;/h3&gt;';
  
  
           $namevar = 'name'.$x;
           $emailvar = 'email'.$x;
  
  
           woocommerce_form_field($namevar , array(
  
          'type' =&gt; 'text',
             'label'      =&gt; __('Name'),
             'placeholder'   =&gt; _x('', 'placeholder', 'woocommerce'),
             'required'   =&gt; true,
             'class'      =&gt; array(''),
             'clear'     =&gt; true,
                 ));
  
          woocommerce_form_field($emailvar, array(
  
          'type' =&gt; 'text',
             'label'      =&gt; __('E-mail'),
             'placeholder'   =&gt; _x('', 'placeholder', 'woocommerce'),
             'required'   =&gt; false,
             'class'      =&gt; array(''),
             'clear'     =&gt; true,
                 ));
  
                  echo '&lt;/div&gt;';
                  $x++;
              }
  
              $i++;
              } 
  
  }
  </code></pre>