assets/js/product.js
// TODO: Add the selected item and quantity to the cart
Add the selected item and quantity to the cart
Add the selected item and quantity to the cart
function addSelectedItemToCart(event) {
  var parentDiv = event.parentNode;
  var id = parentDiv.getAttribute("id");
  var item = document.querySelector("#" + id + " h2").innerHTML;
  var price = document.querySelector("#" + id + " .price").innerHTML;
  var img = document.querySelector("#" + id + " img").src;
  cart.addItem(item, 1, img, price);
}
function addSelectedItemToCart ( event ) { var parentDiv = event . parentNode ; var id = parentDiv . getAttribute ( "id" ) ; var item = document . querySelector ( "#" + id + " h2" ) . innerHTML ; var price = document . querySelector ( "#" + id + " .price" ) . innerHTML ; var img = document . querySelector ( "#" + id + " img" ) . src ; cart . addItem ( item , 1 , img , price ) ; }
TODO: Add the selected item and quantity to the cart
TODO : Add the selected item and quantity to the cart
// TODO: suss out the item picked from the select list // TODO: get the quantity // TODO: using those, add one item to the Cart