nagasurendra commited on
Commit
a0d5227
·
verified ·
1 Parent(s): 42a3b7a

Update templates/cart.html

Browse files
Files changed (1) hide show
  1. templates/cart.html +5 -0
templates/cart.html CHANGED
@@ -179,6 +179,11 @@
179
  } else if (action === 'decrease' && quantity > 1) {
180
  quantity--;
181
  }
 
 
 
 
 
182
  console.log({
183
  email: customerEmail,
184
  item_name: itemName,
 
179
  } else if (action === 'decrease' && quantity > 1) {
180
  quantity--;
181
  }
182
+ if (isNaN(quantity) || quantity < 1) {
183
+ console.error("Invalid quantity:", quantity);
184
+ alert("Quantity must be a valid number greater than 0.");
185
+ return;
186
+ }
187
  console.log({
188
  email: customerEmail,
189
  item_name: itemName,