ShoppingCart

ShoppingCart

new ShoppingCart(props)

Shopping Cart object

Parameters:
Name Type Description
props ShoppingCartProps
Source:

Classes

CartCard

Methods

(static) addQuantity(index, count)

Add quantity to cart (can be positive or negative)

Parameters:
Name Type Description
index number
count number
Source:

(static) addToCart(item)

Add item to cart

Parameters:
Name Type Description
item Dish
Source:

(static) cartSum()

Calculate sum of items in shopping cart

Source:

(static) dishesPerChef() → {Object}

Get dishes for each chef

Source:

(static) getDishes(dishes)

Convert array of dishes into string

Parameters:
Name Type Description
dishes Array
Source:

(static) getLongestTime()

Get longest preparation time of items in cart

Source:

(static) getLongestTimeForChef(chef)

Get longest time for each chef

Parameters:
Name Type Description
chef Chef
Source:

(static) getLongestTimeForChefinMin(chef)

Get longest preparation time for each chef in minutes

Parameters:
Name Type Description
chef Chef
Source:

(static) isolateChefs() → {Object}

Get all chefs of items in shopping cart

Source:

(static) removeChef(chef)

Remove chef from orders

Parameters:
Name Type Description
chef Chef
Source:

(static) subTotal()

Calculate subtotal for shopping cart

Source:

Type Definitions

CartCardProps

Properties:
Name Type Description
price price

of dish

amount quantity

of dish

ID dishid

of dish

title title

of dish

shopping cart

cart copy

Source:

ShoppingCartProps

Properties:
Name Type Description
shopping cart

cart copy

Source: