Rammohan0504 commited on
Commit
034cc03
·
verified ·
1 Parent(s): d3ea1df

Update templates/order_history.html

Browse files
Files changed (1) hide show
  1. templates/order_history.html +3 -4
templates/order_history.html CHANGED
@@ -117,15 +117,15 @@
117
  <script>
118
  function addToCart(itemName) {
119
  // Get the price from the button's data-price attribute
120
- const itemPrice = document.getElementById(itemName).dataset.price; // This is fetched as a string
121
 
122
  if (!itemPrice) {
123
  alert('Price is missing for the item');
124
  return;
125
  }
126
 
127
- // Ensure the price is a string
128
- const itemPriceStr = String(itemPrice); // Ensure it's explicitly converted to a string
129
 
130
  fetch('/cart/add', {
131
  method: 'POST',
@@ -149,7 +149,6 @@
149
  alert('An error occurred: ' + error);
150
  });
151
  }
152
-
153
  </script>
154
 
155
  </body>
 
117
  <script>
118
  function addToCart(itemName) {
119
  // Get the price from the button's data-price attribute
120
+ const itemPrice = document.getElementById(itemName).dataset.price;
121
 
122
  if (!itemPrice) {
123
  alert('Price is missing for the item');
124
  return;
125
  }
126
 
127
+ // Ensure the price is treated as a string
128
+ const itemPriceStr = String(itemPrice); // Explicitly convert to string
129
 
130
  fetch('/cart/add', {
131
  method: 'POST',
 
149
  alert('An error occurred: ' + error);
150
  });
151
  }
 
152
  </script>
153
 
154
  </body>