basic-cart
basic js shopping cart
Last updated 2 years ago by dobiedad .
MIT · Original npm · Tarball · package.json
$ cnpm install basic-cart 
SYNC missed versions from official npm registry.

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()

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

5 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 3
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |