title: opencart update cart total ajax
body: <p>I am trying to implement the cart in the header to update it's price / items when I add an item to the cart</p>
  
  <p>My html:</p>
  
  <pre><code>&lt;div id="cart"&gt;
  &lt;p class="phone"&gt;01234 567890&lt;/p&gt;
  &lt;div class="basket"&gt;
   &lt;p class="title"&gt;&lt;a href="&lt;?php echo $shopping_cart; ?&gt;"&gt;Basket&lt;/a&gt;&lt;/p&gt;
   &lt;p class="items"&gt;
    &lt;?php
    $cart_number = $this-&gt;cart-&gt;countProducts();
    if ($cart_number == 1) {
     echo "1 item";
    } else {
     echo $cart_number." items";
    }
    ?&gt;
   &lt;/p&gt;
   &lt;p class="price"&gt;
    &lt;?php echo $this-&gt;currency-&gt;format($this-&gt;cart-&gt;getTotal()); ?&gt;
   &lt;/p&gt;
    &lt;script type="text/javascript"&gt;
     &lt;!--
     $(document).ready(function () {
      $('#button-cart').bind('click', function() {
  $.ajax({
       url: 'index.php?route=checkout/cart/add',
   type: 'post',
   data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
   dataType: 'json',
   success: function(json) {
    $('.success, .warning, .attention, information, .error').remove();
  
    if (json['error']) {
     if (json['error']['option']) {
      for (i in json['error']['option']) {
       $('#option-' + i).after('&lt;span class="error"&gt;' + json['error']['option'][i] + '&lt;/span&gt;');
      }
     }
    } 
  
    if (json['success']) {
     $('#notification').html('&lt;div class="success" style="display: none;"&gt;' + json['success'] + '&lt;img src="catalog/view/theme/default/image/close.png" alt="" class="close" /&gt;&lt;/div&gt;');
     $('.success').fadeIn('slow');
     $('.price').html(json['total']);
     $('html, body').animate({ scrollTop: 0 }, 'slow'); 
    } 
   }
      });
     });
     });
     //--&gt;
    &lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>It's a custom theme but with most elements copied from the default theme, but for some reason it doesn't update the cart items / total</p>
  
  <p>any help would be appreciated</p>