kisphp-cart-manager

1.0.1 • Public • Published

Js Cart

Simple Javascript Cart manager

Installation

npm install kisphp-cart-manager --save

Usage

 
var cart = Cart;
 
var product_1 = {
    id: 1,
    title: "Product 1",
    description: "Product description"
    // .... more product related data ....
};
 

id property is mandatory

quantity will be added automatically

Add product to cart

// quantity is an integer
cart.add(product_1, quantity);

subtract quantity from cart

// if quantity > available quantity in cart, then it will delete the product from cart
cart.subtract(product_1, quantity);

remove product from cart

cart.remove(product);

See Example for a demo

Package Sidebar

Install

npm i kisphp-cart-manager

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kisphp