Rammohan0504 commited on
Commit
7cab842
·
verified ·
1 Parent(s): 0e0443c

Update templates/order_history.html

Browse files
Files changed (1) hide show
  1. templates/order_history.html +5 -4
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 sent as a string (e.g., "$16.0")
135
- itemPrice = String(itemPrice); // Convert item price to a string (e.g., "$16.0")
136
 
137
  if (!itemPrice || !itemImage || !itemName || !category || !section) {
138
  alert('Missing required item data.');
139
  return;
140
  }
141
 
142
- // Create a data object to send to the server
 
143
  const dataToSend = {
144
  itemName: itemName,
145
- itemPrice: itemPrice, // Send price as string
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