Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hardingadonis committed Dec 5, 2023
1 parent a4d2f1e commit b706b41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion database/setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

-- --------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion src/main/webapp/assets/js/web/productHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/webapp/view/web/checkout.jsp
Original file line number Diff line number Diff line change
@@ -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"%>

<!DOCTYPE html>

<html>
Expand Down

0 comments on commit b706b41

Please sign in to comment.