2.0.0 • Published 4 years ago

calculations-swedish-webshop v2.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Install

npm i calculations-swedish-webshop

Usage

ES6 import:

import calc from 'calculations-swedish-webshop'

Methods:

  1. calcNumberOfProducts: calculates the number of the items in cart. It take an array as parameter and every element in the array should have "quantity" property

  2. calcTotalWithoutShipping: calculates the total price (without shipping) of the items in cart. It take an array as parameter and every element in the array should have "quantity" and "price" properties

  3. calcShipping : calculate shipping : total > 500 => shipping: 0. total <= 500 => shipping: 59

  4. calcTotalWithShipping : calculate the sum of calcTotalWithoutShipping + calcShipping

  5. calcTotalWithoutShippingOrWrapping: Calculate total without shipping or giftwrapping because giftwrapping will not have 25% moms

  6. calcMoms: take two parameters: en array with products + moms percentage to calculate (it uses calcTotalWithoutShippingOrWrapping)

  7. calcTotalMoms: calculate total moms. takes an array of products as parameter, every element in the array should have "quantity", "price" and "moms" properties. "moms" is the moms percentage for the product

  8. calcGiftWrapping: calculate gift wrapping price for the given array of products, every product should have "giftWrapping" and "quantity" properties. Gift wrapping is 25/st

2.0.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago