title: Magento : updating cart items count always returns 0
body: <p>I am trying to display the number of items added to the cart with ajax. and the value displayed is always 0.</p>
  
  <p><strong>Here is what my ajax call looks like  :</strong></p>
  
  <pre><code>$(".btn-cart").click(function(){
  
          $.ajax({
                  url: 'update_cart.php' ,
  
                  type: 'GET',
  
                  success : function(data)
              {
                  $("#cart_items_count").text(data);
                  $("#cart_items_count").show();
              },
  
                  error: function (xhr) {
                  alert(xhr.responseText);
              }
  
  
          });
  
   });
  </code></pre>
  
  <p><strong>update_cart.php code looks like this:</strong></p>
  
  <pre><code>    include 'app/Mage.php';
      Mage::init();
      $cart = Mage::getModel('checkout/cart')-&gt;getQuote();
      $nb_items = count($cart-&gt;getAllItems());
      echo(strval ($nb_items));
  </code></pre>
  
  <p>The value returned to the ajax function is always 0. Any help is much appreciated.</p>