The problem here is that the cart icon does not change the amount automatically on clicking on add to cart
This is the process.php:
session_start();
if (!isset($_SESSION['cart'])){
echo 0;
}else{
echo sizeof($_SESSION['cart']);
}
This is the process.php:
$.post( "process.php", function( data ) {
console.log(data);
$('#count').html(data);
});
This is the HTML page:
<li style="float:left; margin-right:15px; color:blue;" class="list" onclick="toggleCart();"><i class="fa fa-shopping-cart"></i> <span id="count"class="label label-danger"></span></li>