From 149c12ce719da63c7dec77f0eae2a2aa3c475628 Mon Sep 17 00:00:00 2001 From: Gustavo Luigi <=> Date: Wed, 7 Sep 2022 16:36:43 +0200 Subject: [PATCH] . --- assets/js/checkout.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/checkout.js b/assets/js/checkout.js index 0b6f8f4..3da5eca 100644 --- a/assets/js/checkout.js +++ b/assets/js/checkout.js @@ -53,7 +53,8 @@ function updateProducts(){ $(window).on('load', function(){ updateProducts(); $("#successful-submitting-form").delay(4000).slideUp(200, function() { $(this).alert('close'); }); - $('#anfrage').submit(function(){ + $('#anfrage').submit(function(event){ + event.preventDefault(); getInfoFromSelectedProduct().done(function(response, status){ let products = response.contents.map(product => { product = getProductInfo(product); @@ -63,6 +64,7 @@ $(window).on('load', function(){ $('#ccart').val(JSON.stringify({"total-price": totalPrice, "products": products})); objProducts = []; localStorage.setItem("products", JSON.stringify(objProducts)); + $(this).unbind('submit').submit(); }); }); $(document).on('click', '.btn-remove-product', function(){