diff --git a/database/setup.sql b/database/setup.sql index f2a2c7c7..4cd074f3 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -90,7 +90,7 @@ CREATE TABLE `order` ( `payment` enum('cod','vnpay') NOT NULL COMMENT 'Lựa chọn phương thức thanh toán', `status` enum('processing','shipping','done','canceled') NOT NULL COMMENT 'Tình trạng đơn hàng', `create_at` datetime DEFAULT NULL, - `update_at` datetime DEFAULT NULL, + `update_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- diff --git a/src/main/webapp/assets/js/web/productHandler.js b/src/main/webapp/assets/js/web/productHandler.js index d7e5fbd2..58e4d58c 100644 --- a/src/main/webapp/assets/js/web/productHandler.js +++ b/src/main/webapp/assets/js/web/productHandler.js @@ -55,7 +55,12 @@ function addToCart() { let cartCookie = getCartCookie(); if (cartCookie.hasOwnProperty(productID)) { - cartCookie[productID] += currentQuantity; + if (cartCookie[productID] + currentQuantity <= maxAmount) { + cartCookie[productID] += currentQuantity; + } + else { + cartCookie[productID] = maxAmount; + } } else { cartCookie[productID] = currentQuantity; } diff --git a/src/main/webapp/view/web/checkout.jsp b/src/main/webapp/view/web/checkout.jsp index 917c6c7a..648672f4 100644 --- a/src/main/webapp/view/web/checkout.jsp +++ b/src/main/webapp/view/web/checkout.jsp @@ -1,12 +1,6 @@ <%@ page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@page import="io.hardingadonis.miu.model.Product"%> - -<%@page import="org.json.simple.JSONObject"%> -<%@page import="org.json.simple.parser.JSONParser"%> -<%@page import="org.json.simple.parser.ParseException"%> -