-
Notifications
You must be signed in to change notification settings - Fork 1
/
carrinho.html
299 lines (273 loc) · 12.3 KB
/
carrinho.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
<html lang="pt_br">
<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>Carrinho</title>
<!--Favicon-->
<link rel="shortcut icon" href="assets/img/Favicon_Exodia_Store.svg" type="image/x-icon">
<!-- Libraries -->
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<!--Main CSS File-->
<link rel="stylesheet" href="/css/styles.css" />
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</head>
<body>
<!-- ======= Header ======= -->
<header class="header-area">
<div class="navbar-area">
<div class="container">
<div class="row">
<div class="col-lg-12">
<!-- .navbar -->
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="index.html">
<img id="logo" src="/assets/img/Logo Exódia Store.png" alt="Logo" />
</a>
<div class="menu">
<ul class="nav">
<li class="nav-item"><a class="nav-link scrollto" href="index.html">Home</a></li>
<li class="nav-item"><a class="nav-link scrollto" href="#contato">Contato</a></li>
<li class="nav-item"><a class="nav-link scrollto" href="carrinho.html"><i class="fas fa-shopping-cart"></i></a></li>
</ul>
</div>
</nav>
<!-- .navbar -->
</div>
</div>
</div>
</div>
</header>
<!--End Header-->
<!-- ======= Shopping Cart Section ======= -->
<section id="carrinhoCompras" >
<div class="container">
<div class="row">
<div class="col-6" data-aos="fade-right">
<i class="fas fa-cart-arrow-down"></i>
</div>
<div class="itens col-6" data-aos="fade-left">
<div id="itens"> </div>
<div class="valores-carrinho">Total: <span id="total"></span> </div>
<!--Product seeling-->
<script>
var total = 0; // variável que retorna o total dos produtos que estão na LocalStorage.
var i = 0; // variável que irá percorrer as posições
var valor = 0; // variável que irá receber o preço do produto convertido em Float.
for(i=1; i<=99; i++) // verifica até 99 produtos registrados na localStorage
{
var prod = localStorage.getItem("produto" + i + ""); // verifica se há recheio nesta posição.
if(prod != null)
{
// exibe os dados da lista dentro da div itens
document.getElementById("itens").innerHTML += localStorage.getItem("qtd" + i) + " x ";
document.getElementById("itens").innerHTML += localStorage.getItem("produto" + i);
document.getElementById("itens").innerHTML += " ";
document.getElementById("itens").innerHTML += "R$: " + localStorage.getItem("valor" + i) + "<hr>";
// calcula o total dos recheios
valor = parseFloat(localStorage.getItem("valor" + i)); // valor convertido com o parseFloat()
total = (total + valor); // arredonda para 2 casas decimais com o .toFixed(2)
}
}
// exibe o total dos recheios
document.getElementById("total").innerHTML = total.toFixed(2);
</script>
<!-- End Product seeling-->
<button data-bs-toggle="modal" data-bs-target="#modal1" style="margin-top: 30px; color: white;" class="btn btn-info" type="button" id="btn-pagamento"> Pagamento </button>
<button style="margin-top: 30px; color: white;" class="btn btn-info" type="button" onclick=" localStorage.clear(); location.reload();" id="btn-limpar"> Limpar carrinho </button>
<!-- ======= Modal Section ======= -->
<!-- Modal Personal -->
<div class="modal fade" id="modal1" tabindex="-1" aria-labelledby="modal1Label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal1Label">Dados</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Nome Completo</label>
<input type="text" class="form-control" placeholder="Mário José França">
</div>
<div class="form-group">
<label>Rua</label>
<input type="text" class="form-control" placeholder="Rua XYZ, 96">
</div>
<div class="form-group">
<label>Bairro</label>
<input type="text" class="form-control" placeholder="Alphavela">
</div>
<div class="form-group">
<label">Cidade</label>
<input type="text" class="form-control" placeholder="São Paulo">
</div>
<div class="form-group col-sm-2">
<label>Estado</label>
<input type="text" class="form-control" placeholder="SP">
</div>
<div class="form-group col-sm-4">
<label>CEP</label>
<input type="text" class="form-control" placeholder="55555555">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button data-bs-toggle="modal" data-bs-target="#modal2" type="button" class="btn btn-primary">Continuar</button>
</div>
</div>
</div>
</div>
<!-- Modal Payment Form-->
<div class="modal fade" id="modal2" tabindex="-1" aria-labelledby="modal2Label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal2Label">Forma do Pagamento</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div align="Center" class="form-group">
<button data-bs-toggle="modal" data-bs-target="#modalCredito" type="button" class="btn btn-primary">Crédito</button>
<button data-bs-toggle="modal" data-bs-target="#modalDebito" type="button" class="btn btn-primary">Débito</button>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<!-- Modal Credit -->
<div class="modal fade" id="modalCredito" tabindex="-1" aria-labelledby="modal1Label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal1Label">Dados - Crédito</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Nome do Titular</label>
<input type="text" class="form-control" placeholder="Mário José França">
</div>
<div class="form-group">
<label>Número do Cartão</label>
<input type="text" class="form-control" placeholder="1234 4567 7891 2345">
</div>
<div class="form-group">
<label>CVV</label>
<input type="text" class="form-control" placeholder="084">
</div>
<div class="form-group">
<label">Vencimento</label>
<input type="text" class="form-control" placeholder="08/30">
</div>
<div class="form-group col-md-4">
<label for="inputEstado">Parcelas</label>
<select id="inputEstado" class="form-control">
<option selected>Escolher...</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button onclick=" localStorage.clear(); location.reload(); comprar();" data-bs-toggle="modal" data-bs-target="#modal2" type="button" class="btn btn-primary">FInalizar compra</button>
</div>
</div>
</div>
</div>
<!-- Modal Debit -->
<div class="modal fade" id="modalDebito" tabindex="-1" aria-labelledby="modal1Label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal1Label">Dados - Débito</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label>Nome do Titular</label>
<input type="text" class="form-control" placeholder="Mário José França">
</div>
<div class="form-group">
<label>Número do Cartão</label>
<input type="text" class="form-control" placeholder="1234 4567 7891 2345">
</div>
<div class="form-group">
<label>CVV</label>
<input type="text" class="form-control" placeholder="098">
</div>
<div class="form-group">
<label">Vencimento</label>
<input type="text" class="form-control" placeholder="09/29">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button onclick=" localStorage.clear(); location.reload(); comprar();" data-bs-toggle="modal" data-bs-target="#modal2" type="button" class="btn btn-primary">Finalizar compra</button>
</div>
</div>
</div>
</div>
<!--End Modal Section-->
</div>
</div>
</div>
</section>
<!--End Shopping Cart Section-->
<!-- ======= Contact Section ======= -->
<section id="contato">
<div class="container">
<div class="valores">
<h2 data-aos="fade-left" data-aos-delay="100"><strong>Entre em contato agora mesmo!</strong></h2>
<p data-aos="fade-right" data-aos-delay="100">Nos envie uma mensagem, seja dúvida ou encomenda de produto.</p>
<a class="btn btn-info" href="mailto:storeexodia@gmail.com?subject=Titulo&body=Mensagem" target="_blank" title="Envie sua mensagem!">Mandar e-mail</a>
</div>
</div>
</section>
<!--End Contact-->
<!-- ======= Footer Section ======= -->
<footer class="footer-area">
<div class="container ">
<div class="row ">
<div class="col-lg-12 ">
<a href="#home ">
<img style="height: 200px; width: 200px; " src="/assets/img/Logo Exódia Store.png " alt="Logo " />
</a>
<a style="margin-left: 30%; " href="#team ">© COPYRIGHTS EXODIA TEAM. ALL RIGHTS RESERVED.</a>
</div>
</div>
</div>
</div>
</footer>
<!-- End Footer Section -->
<!-- JS Files -->
<script rel="javascript" src="/js/script.js "></script>
<script src="https://unpkg.com/aos@next/dist/aos.js "></script>
<script src="js/aos.js "></script>
<script src="https://kit.fontawesome.com/df0320ea55.js " crossorigin="anonymous "></script>
</body>
</html>