Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.4 kB
0
Indexable
Never
<!-- cart.jsp -->

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Cart</title>
        <style>
            /* CSS styles here */
        </style>
    </head>
    <body>
        <div class="card">
            <div class="row">
                <div class="col-md-8 cart">
                    <div class="title">
                        <div class="row">
                            <div class="col">
                                <h4><b>Shopping Cart</b></h4>
                            </div>
                            <div class="col align-self-center text-right text-muted">${cartItems.size()} items</div>
                        </div>
                    </div>
                    <c:forEach var="item" items="${cartItems}">
                        <div class="row border-top border-bottom">
                            <div class="row main align-items-center">
                                <div class="col-2"><img class="img-fluid" src="${item.getImage()}" /></div>
                                <div class="col">
                                    <div class="item-description text-muted">${item.getName()}</div>
                                    <div class="item-description">${item.getDescription()}</div>
                                </div>
                                <div class="col">
                                    <form action="updateQuantity" method="POST">
                                        <input type="hidden" name="productId" value="${item.getProductId()}">
                                        <input type="number" name="quantity" value="${item.getQuantity()}" min="1">
                                        <input type="submit" value="Update">
                                    </form>
                                </div>
                                <div class="col">$${item.getPrice()} <a href="removeFromCart?productId=${item.getProductId()}">&times;</a></div>
                            </div>
                        </div>
                    </c:forEach>
                    <div class="back-to-shop">
                        <a href="index.jsp">&leftarrow;</a><span class="text-muted">Back to shop</span>
                    </div>
                </div>
                <div class="col-md-4 summary">
                    <div>
                        <h5><b>Summary</b></h5>
                    </div>
                    <hr />
                    <div class="row">
                        <div class="col cart-items">ITEMS ${cartItems.size()}</div>
                        <div class="col text-right">$${totalPrice}</div>
                    </div>
                    <div class="row" style="border-top: 1px solid rgba(0, 0, 0, 0.1); padding: 2vh 0;">
                        <div class="col">TOTAL PRICE</div>
                        <div class="col text-right">$${totalPrice}</div>
                    </div>
                    <a href="order.jsp" class="btn">CHECKOUT</a>
                </div>
            </div>
        </div>
    </body>
</html>