Laser Locker

6. Add Items

In this section we need to program out the buttons to add the cost of an item to our cart. This is a relatively simple step. When a specific button is clicked on, say the hat, we need to add the cost of the hat to our cart list. Once we add that to our list, we should also go ahead and update the label that displays the number of items in our cart. The logic is the same for every button, but each button adds a specific value based on the item. If those two steps are contained in each button click for every item, we are good to go.

Notice that we are adding the cost of the item to the list, not the name of the item.
Next
Back