Update templates/menu.html
Browse files- templates/menu.html +15 -5
templates/menu.html
CHANGED
@@ -592,8 +592,6 @@ form-check-input addon-option{
|
|
592 |
<!-- JavaScript -->
|
593 |
<script>
|
594 |
// Show item details and fetch customization options
|
595 |
-
// Show item details and fetch customization options
|
596 |
-
// Show item details and fetch customization options
|
597 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
598 |
console.log(`Showing details for: ${name}`);
|
599 |
document.getElementById('modal-name').innerText = name;
|
@@ -609,6 +607,21 @@ function showItemDetails(name, price, image, description, section, selectedCateg
|
|
609 |
// Set the default quantity to 1
|
610 |
document.getElementById('quantityInput').value = 1;
|
611 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
// Fetch customization options based on the section
|
613 |
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
614 |
.then(response => response.json())
|
@@ -684,9 +697,6 @@ function showItemDetails(name, price, image, description, section, selectedCateg
|
|
684 |
});
|
685 |
}
|
686 |
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
function handleToggle(source) {
|
691 |
const form = document.getElementById("filter-form");
|
692 |
const veg = document.getElementById("veg-toggle");
|
|
|
592 |
<!-- JavaScript -->
|
593 |
<script>
|
594 |
// Show item details and fetch customization options
|
|
|
|
|
595 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
596 |
console.log(`Showing details for: ${name}`);
|
597 |
document.getElementById('modal-name').innerText = name;
|
|
|
607 |
// Set the default quantity to 1
|
608 |
document.getElementById('quantityInput').value = 1;
|
609 |
|
610 |
+
// Display most common add-ons if available
|
611 |
+
const mostCommonAddonsSection = document.getElementById('most-common-addons');
|
612 |
+
mostCommonAddonsSection.innerHTML = ''; // Clear previous content
|
613 |
+
if (window.most_common_addons && window.most_common_addons.length > 0) {
|
614 |
+
// Display the most common add-ons
|
615 |
+
let commonAddonsText = "<h6>Most Common Add-Ons:</h6><ul>";
|
616 |
+
window.most_common_addons.forEach(addon => {
|
617 |
+
commonAddonsText += `<li>${addon}</li>`;
|
618 |
+
});
|
619 |
+
commonAddonsText += "</ul>";
|
620 |
+
mostCommonAddonsSection.innerHTML = commonAddonsText;
|
621 |
+
} else {
|
622 |
+
mostCommonAddonsSection.innerHTML = '<p>No most common add-ons found.</p>';
|
623 |
+
}
|
624 |
+
|
625 |
// Fetch customization options based on the section
|
626 |
fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
|
627 |
.then(response => response.json())
|
|
|
697 |
});
|
698 |
}
|
699 |
|
|
|
|
|
|
|
700 |
function handleToggle(source) {
|
701 |
const form = document.getElementById("filter-form");
|
702 |
const veg = document.getElementById("veg-toggle");
|