-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.js
31 lines (22 loc) · 830 Bytes
/
checkout.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
let data=JSON.parse(localStorage.getItem("cart"))||[];
console.log(data)
data.map(function app(el){
let tr2=document.createElement("tr");
let pImg=document.createElement("img");
pImg.src=el.image;
pImg.setAttribute("class","productimg");
let td2=document.createElement("td");
td2.append(pImg);
let name=document.createElement("td");
name.setAttribute("class","name")
name.textContent=el.name;
let price=document.createElement("td");
price.textContent=el.price;
price.setAttribute("class","price");
tr2.append(td2,name,price);
document.getElementById("vikas_tbody").append(tr2);
})
let sum=JSON.parse(localStorage.getItem("sum"));
console.log(sum);
document.getElementById("price1").innerText= `₹ ${sum}`;
document.getElementById("price2").innerText= `₹ ${sum}`;