Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Website/__pycache__/views.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Website/templates/newitems.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h3 id = "head"></h3>
<tr>
<td><img src="https://apipics.s3.amazonaws.com/vegan_api/104.jpg" class="rounded-circle img-fluid"></td>
<td>11</td>
<td>Orange, fennel and pea shoot salad with walnuts</td>
<td>Majito</td>
<td>Salad</td>
<td>$8.99</td>
<td>
Expand Down
4 changes: 2 additions & 2 deletions Website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def add_to_cart_STATIC(item_id):
userId = current_user.id
cart_item = Cart.query.filter_by(cartItem_id=item_id, user_id=userId).first()

if cart_item:
if cart_item and item:
cart_item.quantity += 1
else:
match item_id:
Expand Down Expand Up @@ -219,7 +219,7 @@ def add_to_cart_STATIC(item_id):
db.session.add(cart)
case 11:
if not item:
newItem = Item(id = 11,name='Orange, fennel and pea shoot salad with walnuts', price=8.99)
newItem = Item(id = 11,name='Majito', price=8.99)
db.session.add(newItem)
cart = Cart(user_id=userId, cartItem_id=11, quantity=1)
db.session.add(cart)
Expand Down
Binary file modified instance/database.db
Binary file not shown.