-
Notifications
You must be signed in to change notification settings - Fork 1
/
cart.html
122 lines (93 loc) · 3.24 KB
/
cart.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!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>Reliance Digital Cart</title>
<link rel="stylesheet" href="./styles/footer.css">
<link rel="stylesheet" href="./styles/header.css">
<style>
#chkt{
background-color: #e42529;
color: white;
width: 100%;
height: 40px;
border: none;
border-radius: 8px;
}
#checkout{
width: 400px;
border: 1px solid black;
}
p{
color: #818b96;
}
</style>
</head>
<body>
<div id="container"></div>
<div id="cart">
<div id="items">
<button>Remove</button>
<button>Move to wishlist</button>
</div>
<div id="checkout">
<div id="btn">
<a href="./payment.html"><button id="chkt">CHECKOUT</button></a>
<div id="details">
<input type="text" id="Coupon" placeholder="Coupon Code">
<button>Apply</button>
<h4>PRICE DETAILS</h4>
<!-- <h4 id="totamount">AMOUNT PAYABLE</h4> -->
<p>Delivery Charges</p>
<p>Free</p>
<hr>
<h4 id="totamount">AMOUNT PAYABLE</h4>
</div>
<div>
<p>Safe and Secure Payments. Easy returns. 100% Authentic products.</p>
</div>
</div>
</div>
</div>
<footer></footer>
</body>
</html>
<script type="module">
import {footer,header} from "./components/header_footer.js"
let container=document.getElementById("container")
container.innerHTML=header()
let foot=document.querySelector("footer")
foot.innerHTML=footer()
import headerFunctionality from "./scripts/header.js"
headerFunctionality();
let items=JSON.parse(localStorage.getItem("relianceCart"))
console.log(items)
// let cartlength=document.querySelector("h3")
// cartlength.innerText=items.length;
appendcart(items)
function appendcart(el){
//
let div=document.createElement("div")
let img=document.createElement("img")
img.src=el.image
img.style.width="250px"
let name=document.createElement("p")
name.innerHTML=el.name
let price=document.createElement("p")
price.innerText=el.price
let p=document.createElement("p")
p.innerText="*Delivery assurance is subject to our delivery locations staying open as per govt. regulations"
// let btn=document.createElement("button")
// btn.innerHTML="Remove";
// let btn2=document.createElement("button")
// btn2.innerHTML="Move to wishlist";
div.append(img,name,price,p)
let parent=document.getElementById("container");
parent.append(div)
// })
}
let amount=document.getElementById("totamount")
amount.innerText=items.price
</script>