carts
carts
#first item
#name1
if request.form['qty1'].isnumeric()>0:
name1=request.form['name1']
cost1=request.form['cost1']
qty1=request.form['qty1']
list_carts.append([name1,cost1,qty1])
total_cost=total_cost+(float(cost1)*int(qty1))
#name2
if request.form['qty2'].isnumeric()>0:
name2=request.form['name2']
cost2=request.form['cost2']
qty2=request.form['qty2']
list_carts.append([name2,cost2,qty2])
total_cost=total_cost+(float(cost2)*int(qty2))
#name3
if request.form['qty3'].isnumeric()>0:
name3=request.form['name3']
cost3=request.form['cost3']
qty3=request.form['qty3']
list_carts.append([name3,cost3,qty3])
total_cost=total_cost+(float(cost3)*int(qty3))
#name4
if request.form['qty4'].isnumeric()>0:
name4=request.form['name4']
cost4=request.form['cost4']
qty4=request.form['qty4']
list_carts.append([name4,cost4,qty4])
total_cost=total_cost+(float(cost4)*int(qty4))
#name5
if request.form['qty5'].isnumeric()>0:
name5=request.form['name5']
cost5=request.form['cost5']
qty5=request.form['qty5']
list_carts.append([name5,cost5,qty5])
total_cost=total_cost+(float(cost5)*int(qty5))
{{ list_carts }}
[item2,cost2,qty2,subtotal2]
{{ item(0) }}
{{ item(1) }}
{{ item(2) }}
{{ item(3) }}
1,998.00
'{:,.2f}'.format(item(3))
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<style>
.jollibee-header {
background-color: #D62300;
color: white;
padding: 10px 0;
.jollibee-header h2 {
color: #FFD600;
margin: 0;
font-family: 'Pacifico', cursive;
font-size: 2.5rem;
.logo-img {
width: 55px;
height: 55px;
border-radius: 50%;
object-fit: cover;
.jollibee-nav .nav-link {
.jollibee-nav .nav-link:hover {
background-color: #FFD600;
.card-footer .row {
margin-bottom: 1.5rem;
.input-group {
border-radius: 5px;
.input-group-text {
background-color: #FFD600;
color: #D62300;
#cashTendered, #change {
text-align: right;
font-weight: bold;
font-size: 1.1rem;
#change {
background-color: #f0f0f0;
button {
margin-top: 15px;
font-size: 1.1rem;
border-radius: 5px;
}
button:hover {
background-color: #FFD600;
color: #D62300;
#cashTendered:focus {
border-color: #D62300;
</style>
</head>
<body>
<div class="jollibee-header">
</div>
</nav>
</div>
</div>
<div class="row">
<h4>Menu Cart</h4>
</div>
<div class="card-body">
<thead>
<tr>
<th>Qty.</th>
<th>Item</th>
<th>Price</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
</tr>
</tfoot>
</table>
</div>
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-text">₱</span>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-text">₱</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function formatNumberWithCommas(number) {
return number.toLocaleString();
} else {
</script>
</body>
</html>