checkout.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Checkout</title>
<link rel="stylesheet" href="css/styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
<header>
<h1>Checkout</h1>
<nav>
<a href="home.jsp">Home</a>
<a href="cart.jsp">Cart</a>
<a href="products.jsp">Products</a>
</nav>
</header>
<main>
<section class="checkout-container">
<h2>Order Summary</h2>
<table class="checkout-table">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${cart}">
<tr>
<td>${item.name}</td>
<td>$${item.price}</td>
<td>${item.quantity}</td>
<td>$${item.price * item.quantity}</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="checkout-summary">
<p><strong>Total Amount:</strong> $<c:out value="${total}"/></p>
</div>
<h2>Billing Information</h2>
<form method="post" action="processCheckout">
<label for="name">Full Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="address">Address:</label>
<textarea id="address" name="address" rows="4" required></textarea>
<label for="payment">Payment Method:</label>
<select id="payment" name="paymentMethod" required>
<option value="creditCard">Credit Card</option>
<option value="paypal">PayPal</option>
<option value="bankTransfer">Bank Transfer</option>
</select>
<button type="submit" class="submit-btn">Place Order</button>
</form>
</section>
</main>
<footer>
<p>© 2024 Online Grocery Store</p>
</footer>
</body>
</html>
Comments
Post a Comment