This is jquery plugin for a simple cart functionality. The simple shopping cart will be able to
- Add items to cart
- Remove Items from cart (to remove any items make the count to '0').
- Display count of each item
- Display each item total cost & Total cart cost
- Save the cart to local storge.
Include boostarp css/js & Jquery links.
<link rel="stylesheet" href="proxy.php?url=https%3A%2F%2Fmaxcdn.bootstrapcdn.com%2Fbootstrap%2F3.3.6%2Fcss%2Fbootstrap.min.css">
<script src="proxy.php?url=https%3A%2F%2Fmaxcdn.bootstrapcdn.com%2Fbootstrap%2F3.3.6%2Fjs%2Fbootstrap.min.js"></script>
<script src="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Flib%2Fjs%2Fjquery-3.3.1.min.js" ></script>
Include simple Cart css/js
<script src="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Flib%2Fjs%2FjQuery.SimpleCart.js" ></script>
<link href="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Flib%2Fcss%2Fsimple_cart.css" rel="stylesheet">
Products HTML
Check the Example HTML for the sample code. Or you can just add class 'sc-add-to-cart' to the products add button.
Cart HTML
<div class="col-md-3">
<div id="cart"></div>
</div>
Invoke Simple Cart Plugin
<script type="text/javascript">
$(document).ready(function(){
$('#cart').simpleCart();
});
</script>
Example
