A simple, lightweight jQuery plugin for cookie based cart basket.
Include script after the jQuery library (unless you are packaging scripts somehow else):
<script src="/path/to/cartie.js"></script>
**Do not include the script directly from GitHub
The plugin can also be loaded as AMD or CommonJS module.
Set defaults:
$.cartie({currency:"USD"});
Add Item to cart:
$.cartie('add', {id:1,qty:2,price:120,name:"Awesome Product",description:"Red and shiny product"});
Remove Item from cart: (You must set id and qty. If qty greater than currently qty, script removes selected item)
$.cartie('remove', {id:1,qty:2);
Clear cart
$.cartie('clear');
Get items
$.cartie('items');
Get total product
$.cartie('totalProduct');
Get cart total price
$.cartie('totalPrice');
Read default values;
$.cartie("default","currency"); // => "USD"
Check out the Contributing Guidelines
I am used some code blocks from jquery.cookie plugin for this simple cart plugin
=======
A simple, lightweight jQuery plugin for cookie based cart basket.
b02dd7127b57a8fdef1b7be943c2ff67d5c16c30