-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCartPage.html
77 lines (59 loc) · 1.88 KB
/
CartPage.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="products.css">
</head>
<body>
</div>
<hr />
</div>
<div id="images">
<!-- <div class="img">Hi</div>
<div class="img">HI</div>
<div class="img">HI</div>
<div class="img">HI</div>
<div class="img">HI</div> -->
</div>
</div>
</div>
</body>
</html>
<!-- <script>
var cart=JSON.parse(localStorage.getItem("datas"))
console.log(cart)
showProducts(cart)
function showProducts(cart) {
cart.map(function (item) {
var imgs = document.createElement("img");
imgs.setAttribute("src", item.image_url);
imgs.setAttribute("id", "imageSizing");
var type = document.createElement("p");
type.textContent = item.type;
type.setAttribute("class", "paraStyle");
var description = document.createElement("p");
description.textContent = item.dsc;
description.setAttribute("class", "paraStyle1");
var x = document.createElement("div");
x.setAttribute("id", "x");
var price = document.createElement("span");
price.textContent = "₹" + item.MRP;
price.setAttribute("class", "pricing");
var disc = document.createElement("span");
disc.textContent = "₹" + item.discount;
disc.setAttribute("id", "discStyle");
var discPer = document.createElement("span");
discPer.textContent = item.discountPercentage;
discPer.setAttribute("id", "discPerStyle");
x.append(price, disc, discPer);
var imgDiv = document.createElement("div");
imgDiv.setAttribute("id", "img");
imgDiv.append(imgs, type, description, x);
document.getElementById("images").append(imgDiv);
// imgDiv.append(x);
});
}
</script> -->