Spaces:
Sleeping
Sleeping
Update templates/order_history.html
Browse files
templates/order_history.html
CHANGED
@@ -131,18 +131,19 @@
|
|
131 |
const category = button.dataset.category; // Category of the item
|
132 |
const section = button.dataset.section; // Section of the item
|
133 |
|
134 |
-
// Ensure the price is
|
135 |
-
itemPrice = String(itemPrice); //
|
136 |
|
137 |
if (!itemPrice || !itemImage || !itemName || !category || !section) {
|
138 |
alert('Missing required item data.');
|
139 |
return;
|
140 |
}
|
141 |
|
142 |
-
//
|
|
|
143 |
const dataToSend = {
|
144 |
itemName: itemName,
|
145 |
-
itemPrice:
|
146 |
itemImage: itemImage,
|
147 |
addons: [], // Example: No addons for now
|
148 |
instructions: "", // Example: No instructions for now
|
|
|
131 |
const category = button.dataset.category; // Category of the item
|
132 |
const section = button.dataset.section; // Section of the item
|
133 |
|
134 |
+
// Ensure the price is passed as a string (e.g., "$16.0")
|
135 |
+
itemPrice = String(itemPrice); // Ensure itemPrice is a string
|
136 |
|
137 |
if (!itemPrice || !itemImage || !itemName || !category || !section) {
|
138 |
alert('Missing required item data.');
|
139 |
return;
|
140 |
}
|
141 |
|
142 |
+
// Perform calculations with numeric values
|
143 |
+
const numericItemPrice = parseFloat(itemPrice.replace('$', '').trim()); // Convert to numeric value
|
144 |
const dataToSend = {
|
145 |
itemName: itemName,
|
146 |
+
itemPrice: String(numericItemPrice), // Send price as a string
|
147 |
itemImage: itemImage,
|
148 |
addons: [], // Example: No addons for now
|
149 |
instructions: "", // Example: No instructions for now
|