Skip to content

YusufBesim/Cartie.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cartie.JS v 0.3.0

A simple, lightweight jQuery plugin for cookie based cart basket.

Installation

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.

Usage

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"

Contributing

Check out the Contributing Guidelines

Authors

A. Yusuf Besim

Thanks

I am used some code blocks from jquery.cookie plugin for this simple cart plugin

=======

Cartie.js

A simple, lightweight jQuery plugin for cookie based cart basket.

b02dd7127b57a8fdef1b7be943c2ff67d5c16c30

About

A simple, lightweight jQuery plugin for cookie based cart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published