- Type base Shop Cart
- Calculate total and subtotal of a Cart
$ npm install ecommerce-lib
// for v3 payload
const cart = Cart.fromShopCart(data.json);
// or for v4 payload
const cart = Cart.from(data.json);
cart.items[1].quanitty = 5;
const total = cart.getTotal();
const subtotal = cart.getSubtotal();
npm install
npm run build
npm login
npm publish