As a user, I want the total cost of the beer in my cart to be printed below the cards as a Subtotal so I know how much I will be paying for the beer before taxes and shipping fees.
AC
WHEN The user looks at the subtotal,
THEN the total price of all drinks in the cart should be displayed
AND the quantity of each beer should be taken into account
Development
In printCart, declare let beerTotal = 0;
In printCart, create a for loop i = 1; i <= beer.quantity; i++ that when true, takes beer.price and adds it to beerTotal
Add to together all the 'price' object properties together and display it below the final card
User Story
As a user, I want the total cost of the beer in my cart to be printed below the cards as a Subtotal so I know how much I will be paying for the beer before taxes and shipping fees.
AC
WHEN The user looks at the subtotal, THEN the total price of all drinks in the cart should be displayed AND the quantity of each beer should be taken into account
Development
printCart
, declarelet beerTotal = 0;
printCart
, create a for loopi = 1; i <= beer.quantity; i++
that when true, takesbeer.price
and adds it tobeerTotal