Update templates/menu.html
Browse files- templates/menu.html +2 -39
templates/menu.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
@@ -1853,41 +1853,4 @@
|
|
1853 |
itemImage: itemImage,
|
1854 |
section: section,
|
1855 |
category: selectedCategory,
|
1856 |
-
|
1857 |
-
addons: selectedAddOns,
|
1858 |
-
instructions: instructions,
|
1859 |
-
quantity: quantity
|
1860 |
-
};
|
1861 |
-
|
1862 |
-
fetch('/cart/add', {
|
1863 |
-
method: 'POST',
|
1864 |
-
headers: {
|
1865 |
-
'Content-Type': 'application/json',
|
1866 |
-
},
|
1867 |
-
body: JSON.stringify(cartPayload)
|
1868 |
-
})
|
1869 |
-
.then(response => response.json())
|
1870 |
-
.then(data => {
|
1871 |
-
if (data.success) {
|
1872 |
-
alert('Item added to cart successfully!');
|
1873 |
-
updateCartUI(data.cart);
|
1874 |
-
const modal = document.getElementById('itemModal');
|
1875 |
-
const modalInstance = bootstrap.Modal.getInstance(modal);
|
1876 |
-
modalInstance.hide();
|
1877 |
-
} else {
|
1878 |
-
console.error('Failed to add item to cart:', data.error);
|
1879 |
-
alert(data.error || 'Failed to add item to cart.');
|
1880 |
-
}
|
1881 |
-
})
|
1882 |
-
.catch(err => {
|
1883 |
-
console.error('Error adding item to cart:', err);
|
1884 |
-
const cart = addToCartLocalStorage(cartPayload);
|
1885 |
-
updateCartUI(cart);
|
1886 |
-
const modal = document.getElementById('itemModal');
|
1887 |
-
const modalInstance = bootstrap.Modal.getInstance(modal);
|
1888 |
-
modalInstance.hide();
|
1889 |
-
});
|
1890 |
-
}
|
1891 |
-
</script>
|
1892 |
-
</body>
|
1893 |
-
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
|
|
1853 |
itemImage: itemImage,
|
1854 |
section: section,
|
1855 |
category: selectedCategory,
|
1856 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|