title: Get woocommerce order total with ajax
body: <p>I am using the snippet from the woothemes that can be found <a href="http://docs.woothemes.com/document/show-cart-contents-total/" rel="nofollow">here</a>. </p>
  
  <p>Here's the code for front-end:</p>
  
  <pre><code>&lt;?php global $woocommerce; ?&gt;
  
  &lt;a class="cart-contents" href="&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_url(); ?&gt;" title="&lt;?php _e('View your shopping cart', 'woothemes'); ?&gt;"&gt;&lt;?php echo sprintf(_n('%d item', '%d items', $woocommerce-&gt;cart-&gt;cart_contents_count, 'woothemes'), $woocommerce-&gt;cart-&gt;cart_contents_count);?&gt; - &lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_total(); ?&gt;&lt;/a&gt;
  </code></pre>
  
  <p>and for backend (functions.php)</p>
  
  <pre><code>add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
  
  function woocommerce_header_add_to_cart_fragment( $fragments ) {
      global $woocommerce;
  
      ob_start();
  
      ?&gt;
      &lt;a class="cart-contents" href="&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_url(); ?&gt;" title="&lt;?php _e('View your shopping cart', 'woothemes'); ?&gt;"&gt;&lt;?php echo sprintf(_n('%d item', '%d items', $woocommerce-&gt;cart-&gt;cart_contents_count, 'woothemes'), $woocommerce-&gt;cart-&gt;cart_contents_count);?&gt; - &lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_total(); ?&gt;&lt;/a&gt;
      &lt;?php
  
      $fragments['a.cart-contents'] = ob_get_clean();
  
      return $fragments;
  
  }
  </code></pre>
  
  <p>I want to get the order total that can be found after adding coupon code. </p>
  
  <pre><code>&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_total(); ?&gt;
  </code></pre>
  
  <p>The code above will just display the total amount of cart when adding a product, but not the total order. How can I display the total order with discount when adding product to cart?</p>