Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cart.js #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ let AddtoCart = (ev) =>{
let AddListeners = ()=>{
for(let i =0;i<cart.length;i{
{
let j = "minus--" + cart[i].id;
let l = "plus--" + cart[i].id;
let j = `minus--${cart[i].id}`;
let l = `plus--${cart[i].id}`;
let s = document.getElementById(l);
let k = document.getElementById(j);
let w = "delete--" + cart[i].id;
let w = `delete--${cart[i].id}`;
let q = document.getElementById(w);
console.log(k)
q.addEventListener('click', DeleteFromCart);
Expand All @@ -74,10 +74,10 @@ let AddListeners = ()=>{
}
}
let RefreshItems = (n,i,k) =>{
let id = "quantity--"+i;
let id = `quantity--${i}`;
let k = document.getElementById(id);
k.innerHTML = n;
let r = "price--"+i;
let r = `price--${i}`;
let e = document.getElementById(r);
var t = document.getElementById("cost");
let price = e.innerText;
Expand Down Expand Up @@ -157,7 +157,7 @@ let loadItems = () =>{
var n = Number(cart[i].id);
console.log(cart);
var q = Number(cart[i].quantity);
cost = cost + Number(data[n].price*q);
cost += Number(data[n].price*q);
$("#Detail--c").append(`<div class="Detail--item" id="${n}">
<div class="Detail--item--col1">
<div class="item--image--container">
Expand Down