-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcart.php
More file actions
160 lines (130 loc) · 4.31 KB
/
cart.php
File metadata and controls
160 lines (130 loc) · 4.31 KB
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
<!DOCTYPE html>
<html lang="pt-BR">
<?php
session_start();
include("partials/head.php");
?>
<body class="animsition">
<?php
include("partials/header.php");
?>
<!-- breadcrumb -->
<div class="container">
<div class="bread-crumb flex-w p-l-25 p-r-15 p-t-30 p-lr-0-lg">
<a href="index.html" class="stext-109 cl8 hov-cl1 trans-04">
Home
<i class="fa fa-angle-right m-l-9 m-r-10" aria-hidden="true"></i>
</a>
<span class="stext-109 cl4">
Shoping Cart
</span>
</div>
</div>
<!-- Shoping Cart -->
<div class="bg0 p-t-75 p-b-85">
<div class="container">
<div class="row">
<div class="col-lg-10 col-xl-7 m-lr-auto m-b-50">
<div class="m-l-25 m-r--38 m-lr-0-xl">
<div class="wrap-table-shopping-cart">
<table class="table-shopping-cart">
<tr class="table_head">
<th class="column-1">Action</th>
<th class="column-2">Name</th>
<th class="column-3">Price</th>
<th class="column-4">Quantity</th>
<th class="column-5">Total</th>
</tr>
<?php
$total = 0;
if (isset($_SESSION['cart'])) {
$total = 0;
foreach ($_SESSION['cart'] as $key => $value) {
$total = $total + $value['item_price'] * $value['quantity'];
?>
<tr class="table_row">
<td class="column-1">
<div>
<form action="cartremove.php" method="post">
<button class="btn btn-sm btn-outline-danger" name="remove">Remover</button>
<input type="hidden" name="item_name" value='<?php echo $value['item_name'] ?>' />
</form>
</div>
</td>
<td class="column-2"><?php echo $value['item_name'] ?></td>
<td class="column-3">R$ <?php echo $value['item_price'] ?></td>
<td class="column-5">
<form action="cartupdate.php" method="post">
<div class="wrap-num-product flex-w m-l-auto m-r-0">
<div class="btn-num-product-down cl8 hov-btn3 trans-04 flex-c-m">
<i class="fs-16 zmdi zmdi-minus"></i>
</div>
<input name="quantity" class="mtext-104 cl3 txt-center num-product" type="number" value="<?php echo $value['quantity'] ?>">
<div class="btn-num-product-up cl8 hov-btn3 trans-04 flex-c-m">
<i class="fs-16 zmdi zmdi-plus"></i>
</div>
</div>
</td>
<td class="column-5">
<button class="btn btn-sm btn-primary" name="update">Update Cart</button>
<input type="hidden" name="item_name" value='<?php echo $value['item_name'] ?>' />
</form>
</td>
</tr>
<?php }
} ?>
</table>
</div>
<div class="flex-w flex-sb-m bor15 p-t-18 p-b-15 p-lr-40 p-lr-15-sm">
<div class="flex-w flex-m m-r-20 m-tb-5">
<input class="stext-104 cl2 plh4 size-117 bor13 p-lr-20 m-r-10 m-tb-5" type="text" name="coupon" placeholder="Coupon Code">
<div class="flex-c-m stext-101 cl2 size-118 bg8 bor13 hov-btn3 p-lr-15 trans-04 pointer m-tb-5">
Apply coupon
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-10 col-lg-7 col-xl-5 m-lr-auto m-b-50">
<div class="bor10 p-lr-40 p-t-30 p-b-40 m-l-63 m-r-40 m-lr-0-xl p-lr-15-sm">
<h4 class="mtext-109 cl2 p-b-30">
Cart Totals
</h4>
<div class="flex-w flex-t bor12 p-b-13">
<div class="size-208">
<span class="stext-110 cl2">
Subtotal:
</span>
</div>
<div class="size-209">
<span class="mtext-110 cl2">
R$ <?php echo $total ?>
</span>
</div>
</div>
<div class="flex-w flex-t p-t-27 p-b-33">
<div class="size-208">
<span class="mtext-101 cl2">
Total:
</span>
</div>
<div class="size-209 p-t-1">
<span class="mtext-110 cl2">
R$ <?php echo $total ?>
</span>
</div>
</div>
<button onclick="location.href='cart2.php'" class="flex-c-m stext-101 cl0 size-116 bg3 bor14 hov-btn3 p-lr-15 trans-04 pointer">
Proceed to Checkout
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<?php
include("partials/footer.php");
?>
</body>
</html>