test-space / checkout.html
KingNish's picture
Implemented product details, shopping cart, and checkout functionality (#20)
5cc830e verified
raw
history blame
2.16 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Checkout</title>
<link href="style.css" rel="stylesheet">
</head>
<body class="bg-gray-100">
<header class="bg-amazon-blue p-4 text-white">
<div class="container mx-auto">
<div class="flex justify-between items-center">
<h1 class="text-2xl font-bold">Amazon Dummy</h1>
<a href="cart.html" class="text-white">Cart</a>
</div>
</div>
</header>
<main class="container mx-auto mt-8">
<h2 class="text-2xl font-semibold mb-4">Checkout</h2>
<form id="checkout-form">
<div class="mb-4">
<label for="shipping-address" class="block text-gray-700 text-sm font-bold mb-2">Shipping Address:</label>
<textarea id="shipping-address" name="shipping-address" rows="4" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"></textarea>
</div>
<div class="mb-4">
<label for="payment-info" class="block text-gray-700 text-sm font-bold mb-2">Payment Information:</label>
<input type="text" id="payment-info" name="payment-info" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<button type="submit" class="bg-amazon-yellow hover:bg-yellow-500 text-black font-bold py-2 px-4 rounded">
Place Order
</button>
</form>
</main>
<footer class="bg-gray-200 p-4 mt-8 text-center">
<p>&copy; 2024 Amazon Dummy</p>
</footer>
</body>
</html>
<script>
document.getElementById('checkout-form').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent the default form submission
// Redirect to the confirmation page
window.location.href = 'confirmation.html';
});
</script>