Spaces:
Runtime error
Runtime error
Update templates/menu.html
Browse files- templates/menu.html +30 -3
templates/menu.html
CHANGED
@@ -456,6 +456,10 @@
|
|
456 |
|
457 |
<div id="first-row">
|
458 |
<h6 id="first-row-title" style="display: none;">Customization Options</h6>
|
|
|
|
|
|
|
|
|
459 |
<div class="addon-section">
|
460 |
<h6>Type</h6>
|
461 |
<div id="type-options"></div>
|
@@ -506,12 +510,14 @@
|
|
506 |
|
507 |
document.getElementById('quantityInput').value = 1;
|
508 |
|
|
|
509 |
const typeOptions = document.getElementById('type-options');
|
510 |
const spiceLevelOptions = document.getElementById('spice-level-options');
|
511 |
const firstRow = document.getElementById('first-row');
|
512 |
const firstRowTitle = document.getElementById('first-row-title');
|
513 |
const addonsTitle = document.getElementById('addons-title');
|
514 |
|
|
|
515 |
typeOptions.innerHTML = '';
|
516 |
spiceLevelOptions.innerHTML = '';
|
517 |
|
@@ -539,6 +545,20 @@
|
|
539 |
|
540 |
if (section.toLowerCase() === 'starters') {
|
541 |
data.addons.forEach(addon => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
if (addon.name.toLowerCase() === "type") {
|
543 |
addon.options.forEach(option => {
|
544 |
const optionId = `addon-type-${option}`;
|
@@ -572,7 +592,9 @@
|
|
572 |
|
573 |
data.addons.forEach(addon => {
|
574 |
if (section.toLowerCase() === 'starters' &&
|
575 |
-
(addon.name.toLowerCase() === "type" ||
|
|
|
|
|
576 |
return;
|
577 |
}
|
578 |
|
@@ -603,7 +625,6 @@
|
|
603 |
});
|
604 |
|
605 |
const startersOrder = [
|
606 |
-
"Choose Preparation Style",
|
607 |
"Select Dip/Sauce",
|
608 |
"Extra Add-ons",
|
609 |
"Make it a Combo"
|
@@ -719,6 +740,12 @@
|
|
719 |
}));
|
720 |
|
721 |
if (section.toLowerCase() === 'starters') {
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
const typeOptions = Array.from(
|
723 |
document.querySelectorAll('#type-options input[type="checkbox"]:checked')
|
724 |
).map(option => ({
|
@@ -731,7 +758,7 @@
|
|
731 |
name: option.getAttribute('data-name') || 'Default Spice Level',
|
732 |
price: 0
|
733 |
}));
|
734 |
-
selectedAddOns = [...selectedAddOns, ...typeOptions, ...spiceLevelOptions];
|
735 |
}
|
736 |
|
737 |
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
|
|
|
456 |
|
457 |
<div id="first-row">
|
458 |
<h6 id="first-row-title" style="display: none;">Customization Options</h6>
|
459 |
+
<div class="addon-section">
|
460 |
+
<h6>Choose Preparation Style</h6>
|
461 |
+
<div id="prep-style-options"></div>
|
462 |
+
</div>
|
463 |
<div class="addon-section">
|
464 |
<h6>Type</h6>
|
465 |
<div id="type-options"></div>
|
|
|
510 |
|
511 |
document.getElementById('quantityInput').value = 1;
|
512 |
|
513 |
+
const prepStyleOptions = document.getElementById('prep-style-options');
|
514 |
const typeOptions = document.getElementById('type-options');
|
515 |
const spiceLevelOptions = document.getElementById('spice-level-options');
|
516 |
const firstRow = document.getElementById('first-row');
|
517 |
const firstRowTitle = document.getElementById('first-row-title');
|
518 |
const addonsTitle = document.getElementById('addons-title');
|
519 |
|
520 |
+
prepStyleOptions.innerHTML = '';
|
521 |
typeOptions.innerHTML = '';
|
522 |
spiceLevelOptions.innerHTML = '';
|
523 |
|
|
|
545 |
|
546 |
if (section.toLowerCase() === 'starters') {
|
547 |
data.addons.forEach(addon => {
|
548 |
+
if (addon.name.toLowerCase() === "choose preparation style") {
|
549 |
+
addon.options.forEach(option => {
|
550 |
+
const optionId = `addon-prep-style-${option}`;
|
551 |
+
const optionHTML = `
|
552 |
+
<div class="form-check">
|
553 |
+
<input type="checkbox" class="form-check-input" id="${optionId}" value="${option}" data-name="${option}" data-group="Choose Preparation Style">
|
554 |
+
<label class="form-check-label" for="${optionId}">
|
555 |
+
${option}
|
556 |
+
</label>
|
557 |
+
</div>
|
558 |
+
`;
|
559 |
+
prepStyleOptions.innerHTML += optionHTML;
|
560 |
+
});
|
561 |
+
}
|
562 |
if (addon.name.toLowerCase() === "type") {
|
563 |
addon.options.forEach(option => {
|
564 |
const optionId = `addon-type-${option}`;
|
|
|
592 |
|
593 |
data.addons.forEach(addon => {
|
594 |
if (section.toLowerCase() === 'starters' &&
|
595 |
+
(addon.name.toLowerCase() === "type" ||
|
596 |
+
addon.name.toLowerCase() === "spice level" ||
|
597 |
+
addon.name.toLowerCase() === "choose preparation style")) {
|
598 |
return;
|
599 |
}
|
600 |
|
|
|
625 |
});
|
626 |
|
627 |
const startersOrder = [
|
|
|
628 |
"Select Dip/Sauce",
|
629 |
"Extra Add-ons",
|
630 |
"Make it a Combo"
|
|
|
740 |
}));
|
741 |
|
742 |
if (section.toLowerCase() === 'starters') {
|
743 |
+
const prepStyleOptions = Array.from(
|
744 |
+
document.querySelectorAll('#prep-style-options input[type="checkbox"]:checked')
|
745 |
+
).map(option => ({
|
746 |
+
name: option.getAttribute('data-name') || 'Default Prep Style',
|
747 |
+
price: 0
|
748 |
+
}));
|
749 |
const typeOptions = Array.from(
|
750 |
document.querySelectorAll('#type-options input[type="checkbox"]:checked')
|
751 |
).map(option => ({
|
|
|
758 |
name: option.getAttribute('data-name') || 'Default Spice Level',
|
759 |
price: 0
|
760 |
}));
|
761 |
+
selectedAddOns = [...selectedAddOns, ...prepStyleOptions, ...typeOptions, ...spiceLevelOptions];
|
762 |
}
|
763 |
|
764 |
const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
|