From d3dbda638b34da003a031f13fc960c3b1c6c7b76 Mon Sep 17 00:00:00 2001 From: moepoi Date: Sat, 20 Nov 2021 14:04:03 +0700 Subject: [PATCH] Fix checkout bug --- public/js/checkout.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/js/checkout.js b/public/js/checkout.js index 35889dc..f6a73ba 100644 --- a/public/js/checkout.js +++ b/public/js/checkout.js @@ -3,6 +3,9 @@ function proceedCheckout() { } function view_checkout() { + if (localStorage.getItem("bag") === null) { + localStorage.setItem("bag", "[]"); + } var bag = JSON.parse(localStorage.getItem("bag")); var html = ''; var total_price = 0;