Basic Add To Shopping Cart Plugin With jQuery - SimpleCart

File Size: 6.87 KB
Views Total: 18479
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Basic Add To Shopping Cart Plugin With jQuery - SimpleCart

The SimpleCart jQuery plugin makes it easy to integrate add to cart and shopping cart functionalities into your online store.

The plugin enables your customers to add products to your shopping cart and dynamically update your total for the product depending on the quantity.

It also has the ability to persist cart items on page refresh. Based on HTML5 local storage.

How to use it:

1. Link to jQuery library and the jQuery SimpleCart plugin's files.

<link href="/simple_cart.css" rel="stylesheet">
<script src="" 
<script src="/jQuery.SimpleCart.js" ></script>

2. Load the Bootstrap and Font Awesome for the basic styling.

<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="fontawesome.min.css">

3. Add the 'Add To Cart' btuton to the product and specify the product name & price in the data attributes:

<button class="sc-add-to-cart" 
        ADD To Cart

4. Create a DIV container to place the shopping cart.

<div id="cart"></div>

5. Call the plugin to activate the shoppint cart.

$(document).ready(function () {

6. All default CSS selectors.

$(document).ready(function () {
    addtoCartClass: '.sc-add-to-cart',
    cartProductListClass: '.cart-products-list',
    totalCartCountClass: '.total-cart-count',
    totalCartCostClass: '.total-cart-cost',
    showcartID : '#show-cart',
    itemCountClass : '.item-count'

This awesome jQuery plugin is developed by RedIsTheNewBlue. For more Advanced Usages, please check the demo page or visit the official website.