forked from arjankc/online-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart2.php
152 lines (148 loc) · 7.43 KB
/
cart2.php
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
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include("handler/customersession.php");
include ("files/head.php");
?>
<body class="animsition">
<?php
include ("files/header.php");
?>
<!-- breadcrumb -->
<div class="container">
</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"></th>
</tr>
<?php
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 class="">
<form action="cartremove.php" method="POST">
<button class="btn btn-sm btn-outline-danger" name="remove">Remove</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">Rs <?php echo $value['item_price'] ?></td>
<td class="column-4">
<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 class="mtext-104 cl3 txt-center num-product" type="number" name="num-product1" 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-outline-danger" name="update">
update
</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">
</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">
Rs <?php echo $total ?>
</span>
</div>
</div>
<div class="flex-w flex-t bor12 p-t-15 p-b-30">
<div class="size-208 w-full-ssm">
<span class="stext-110 cl2">
Shipping:
</span>
</div>
<div class="size-209 p-r-18 p-r-0-sm w-full-ssm">
<p class="stext-111 cl6 p-t-2">
Free delivery all over Nepal!!
</p>
<div class="p-t-15">
<form action="handler/orderhandler.php" method="POST">
<div class="bor8 bg0 m-b-12">
<input class="stext-111 cl8 plh3 size-111 p-lr-15" type="text" name="address" placeholder="address" required>
</div>
<div class="bor8 bg0 m-b-22">
<input class="stext-111 cl8 plh3 size-111 p-lr-15" type="text" name="phone" placeholder="Phone number" required>
</div>
<div class="rs1-select2 rs2-select2 bor8 bg0 m-b-12 m-t-9">
<select class="js-select2" name="payment">
<!-- add values -->
<option value="cash">Cash on delivery</option>
<option value="paypal">Paypal</option>
<option value="eSewa">eSewa</option>
</select>
<div class="dropDownSelect2"></div>
</div>
</div>
</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">
Rs <?php echo $total ?>
</span>
</div>
</div>
<input type="hidden" name="total" value="<?php echo $total ?>">
<button class="flex-c-m stext-101 cl0 size-116 bg3 bor14 hov-btn3 p-lr-15 trans-04 pointer" type="submit" name="placeorder">
Place Order
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
include('files/footer.php');
?>
</body>
</html>