-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathviewcart.php
170 lines (155 loc) · 6.39 KB
/
viewcart.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php session_start();
require('includes/config.php');
?>
<!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>Home | Grocery Store</title>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css">
</head>
<body class="grid">
<!-- Header -->
<header class="header" id="header">
<nav class="nav container">
<a href="index.php" class="nav__logo">Grocery Store</a>
<div class="nav__menu" id="nav-menu">
<?php
include("includes/menu.php");
?>
<i class="uil uil-times nav__close" id="nav-close"></i>
</div>
<div class="nav__btns">
<div class="nav__toggle" id="nav-toggle">
<i class="uil uil-bars"></i>
</div>
</div>
</nav>
</header>
<main>
<section class="category__title-container">
<h1 class="category__title">
Cart
</h1>
</section>
<section class="recommended" id="recommended">
<form action="cart_process.php" method="post">
<div class="section-items grid" style="max-width: 968px;">
<!-- <div class="item">
<img src="assets/images/store-drinks/all/1.jpg" alt="">
<div class="item-text grid">
<h3>Brand Name</h3>
<h4>Product Name</h4>
<p><span>MRP. 00</span>
<button>Remove from cart</button></p>
</div>
</div> -->
<?php
$total = 0;
if(isset($_SESSION['cart'])){
foreach($_SESSION['cart'] as $id => $x){
echo '
<div class="item">
<img src="'.$x['product_image'].'" alt="">
<div class="item-text grid">
<h3>'.$x['product_brand'].'</h3>
<h4>'.$x['product_name'].'</h4>
<p><span>MRP. '.($x['product_price']*$x['quantity']).'</span>
<a class ="button" href="cart_process.php?id='.$id.'" >Remove from cart</a>
</p>
</div>
</div>
';
$total = $total + ($x['quantity']*$x['product_price']);
}
}
?>
<!-- <div class="item">
<img src="assets/images/store-drinks/all/10.jpg" alt="">
<div class="item-text grid">
<h3>Brand Name</h3>
<h4>Product Name</h4>
<p><span>MRP. 00</span>
<button>Remove from cart</button></p>
</div>
</div>
<div class="item">
<img src="assets/images/store-drinks/all/11.jpg" alt="">
<div class="item-text grid">
<h3>Brand Name</h3>
<h4>Product Name</h4>
<p><span>MRP. 00</span>
<button>Remove from cart</button></p>
</div>
</div>
<div class="item">
<img src="assets/images/store-drinks/all/12.jpg" alt="">
<div class="item-text grid">
<h3>Brand Name</h3>
<h4>Product Name</h4>
<p><span>MRP. 00</span>
<button>Remove from cart</button></p>
</div>
</div> -->
</div>
</form>
<div class="grid cart_buttons">
<h4> Total Price: <?php echo $total;?></h4>
<button type='submit'>Re-calculate</button>
<a href="checkout.php" class="button">Checkout</a>
</div>
</section>
</main>
<footer class="footer">
<div class="footer__container grid">
<div class="footer__logo">
<h1 class="footer__title">Grocery Store</h1>
<span class="footer__subtitle">
Project by Shreyas, Rutuja & Sauhard.
</span>
</div>
<div class="footer__about">
<h1 class="footer__about-title">About</h1>
<ul class="footer__links">
<li>
<a href="" class="footer__link">About Us</a>
</li>
<li>
<a href="" class="footer__link">Contact</a>
</li>
<li>
<a href="" class="footer__link">Return Policy</a>
</li>
<li>
<a href="" class="footer__link">Privacy Policy</a>
</li>
</ul>
</div>
<div class="footer__socials">
<a href="https://github.com/" target="_blank" class="footer__social">
<i class="uil uil-github"></i>
</a>
<a href="https://www.linkedin.com/in//" target="_black" class="footer__social">
<i class="uil uil-linkedin"></i>
</a>
<a href="https://www.instagram.com//" target="_black" class="footer__social">
<i class="uil uil-instagram"></i>
</a>
<a href="https://twitter.com/" target="_black" class="footer__social">
<i class="uil uil-twitter-alt"></i>
</a>
</div>
<p class="footer__copy">© Front End by Shreyas</p>
</div>
</footer>
<!-- Scroll Up -->
<a href="" class="scrollup" id="scroll-up">
<i class="uil uil-arrow-up scrollup__icon"></i>
</a>
<!-- Javascript -->
<script src="assets/js/main.js"></script>
</body>
</html>