title: Shopping Cart Quantity Value Update using AJAX Session
body: <p>I'm doing with a WP Site, I've a Shop cart(plugins) and product page where products are listed it has a calss eStore_button.</p>
  
  <pre><code>&lt;input class="eStore_button" type="image" alt="Add to Cart" src="http://localhost/met/wp-content/uploads/2013/03/add-to-cart.gif"&gt;
  </code></pre>
  
  <p>So I've done a div area on WP Header page where cart quantity will display </p>
  
  <pre><code>&lt;td align="center" valign="middle" width="110" class="numberincart"&gt;&lt;a href="&lt;?php bloginfo('url'); ?&gt;/shoppingcart" class="start-selling-first"&gt;&lt;span id="numberincart"&gt;&lt;p&gt;&lt;?php echo $_GET['inCart'] ?&gt;&lt;/p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>And I have tried when a user will add a product so very recently it will update on the top of the header so I've wrote below things but not working (the results are not updating on the header, while using firebug I didn't find any bug).</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function($){
       $(".eStore_button").live("click",function(event){
          $.ajax({ url: "&lt;?php bloginfo('url'); ?&gt;/products?inCart=&lt;?php $_SESSION['inCart']?&gt;",
          }
          error: function() {
              alert('Error occured');
          }
              });
  
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Only it is working if I put like this, but not without refresh ... </p>
  
  <pre><code>   &lt;td align="center" valign="middle" width="110" class="numberincart"&gt;&lt;a href="&lt;?php bloginfo('url'); ?&gt;/shoppingcart" class="start-selling-first"&gt;&lt;span id="numberincart"&gt;&lt;p&gt;&lt;?php echo $_SESSION['inCart'] ?&gt;&lt;/p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
  </code></pre>