1.0.4 • Published 6 years ago

basic-cart v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Basic Cart

Install

npm

npm i basic-cart -S

Usage

import Cart from 'basic-cart';

const cart = new Cart()
const product = {id:'123',name:"Apple",price:'2.56'}

Add Product

cart.add(product)

Remove Product

cart.remove(product)

Count items

cart.count()

Get items as an array

cart.getItems()

Calculate Total

cart.total()

Calculate Total For Product

cart.totalForProduct(product)

Reset Items

cart.reset()
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago