Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -112,6 +112,40 @@ def filter_menu(preference):
|
|
112 |
return "<p>No items match your filter.</p>"
|
113 |
|
114 |
return html_content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
# Updated Cart Modal HTML
|
116 |
def create_cart_modal():
|
117 |
cart_modal_html = """
|
|
|
112 |
return "<p>No items match your filter.</p>"
|
113 |
|
114 |
return html_content
|
115 |
+
# Create Modal Window HTML
|
116 |
+
def create_modal_window():
|
117 |
+
add_ons = load_add_ons_from_salesforce()
|
118 |
+
add_ons_html = ""
|
119 |
+
for add_on in add_ons:
|
120 |
+
add_ons_html += f"""
|
121 |
+
<label>
|
122 |
+
<input type="checkbox" name="biryani-extra" value="{add_on['Name']}" data-price="{add_on['Price__c']}" />
|
123 |
+
{add_on['Name']} + ${add_on['Price__c']}
|
124 |
+
</label>
|
125 |
+
<br>
|
126 |
+
"""
|
127 |
+
|
128 |
+
modal_html = f"""
|
129 |
+
<div id="modal" style="display: none; position: fixed; background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000;">
|
130 |
+
<div style="text-align: right;">
|
131 |
+
<button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">×</button>
|
132 |
+
</div>
|
133 |
+
<img id="modal-image" style="width: 100%; height: 300px; border-radius: 8px; margin-bottom: 20px;" />
|
134 |
+
<h2 id="modal-name"></h2>
|
135 |
+
<p id="modal-description"></p>
|
136 |
+
<p id="modal-price"></p>
|
137 |
+
<label for="biryani-extras"><strong>Add-ons :</strong></label>
|
138 |
+
<div id="biryani-extras-options" style="display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;">
|
139 |
+
{add_ons_html}
|
140 |
+
</div>
|
141 |
+
<label for="quantity">Quantity:</label>
|
142 |
+
<input type="number" id="quantity" value="1" min="1" style="width: 50px;" />
|
143 |
+
<textarea id="special-instructions" placeholder="Add your special instructions here..." style="width: 100%; height: 60px;"></textarea>
|
144 |
+
<button style="background-color: #28a745; color: white; border: none; padding: 10px 20px; font-size: 14px; border-radius: 5px; cursor: pointer;" onclick="addToCart()">Add to Cart</button>
|
145 |
+
</div>
|
146 |
+
"""
|
147 |
+
return modal_html
|
148 |
+
|
149 |
# Updated Cart Modal HTML
|
150 |
def create_cart_modal():
|
151 |
cart_modal_html = """
|