php - 如何将这些产品设置为具有相同的订单 ID、发票和付款方式?
问题描述
我的购物车结帐将所选产品提交到“我的订单页面”,其中产品被分成不同的行,并使用相同的发票编号进行单独付款。如何将这些行合并为一列,其中包含所有三种产品的总价格和总数量以及一种付款方式?
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th> ON: </th>
<th> Due Amount: </th>
<th> Invoice No: </th>
<th> Qty: </th>
<th> Size: </th>
<th> Order Date: </th>
<th> Paid / Unpaid: </th>
<th> Status: </th>
</tr>
</thead>
<tbody>
<?php
$customer_session = $_SESSION['customer_email'];
$get_customer = "select * from customers where customer_email='$customer_session'";
$run_customer = mysqli_query($con,$get_customer);
$row_customer = mysqli_fetch_array($run_customer);
$customer_id = $row_customer['customer_id'];
$get_orders = "select * from customer_orders where customer_id='$customer_id'";
$run_orders = mysqli_query($con,$get_orders);
$i = 0;
while($row_orders = mysqli_fetch_array($run_orders)){
$order_id = $row_orders['order_id'];
$due_amount = $row_orders['due_amount'];
$invoice_no = $row_orders['invoice_no'];
$qty = $row_orders['qty'];
$size = $row_orders['size'];
$order_date = substr($row_orders['order_date'],0,11);
$order_status = $row_orders['order_status'];
$i++;
if($order_status == 'Pending'){
$order_status = 'Unpaid';
}else{
$order_status = 'Paid';
}
?>
<tr>
<th> <?php echo $i; ?> </th>
<td> AED<?php echo $due_amount; ?> </td>
<td> <?php echo $invoice_no; ?> </td>
<td> <?php echo $qty; ?> </td>
<td> <?php echo $size; ?> </td>
<td> <?php echo $order_date; ?> </td>
<td> <?php echo $order_status; ?> </td>
<td>
<a href="confirm.php?order_id=<?php echo $order_id; ?>" target="_blank" class="btn btn-primary btn-sm"> Confirm Payment </a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>```
解决方案
推荐阅读
- python-3.x - 在 requests.put 中添加 headers 和 payload
- java - intelij 多模块 Maven 功能
- excel - 如何在单元格中搜索逗号并根据是否找到逗号执行两个操作之一?
- c# - 如何在 BOT v4 中向 MS 团队发送主动消息
- java - 调用从 Scala 接收可变数量参数的 Java 方法
- php - simpleXMLElement 自己删除编码
- r - ColorNumeric 的“无法确定域范围”
- javascript - 在 Typescript 中以编程方式折叠引导导航栏
- android - 调用函数未捕获来自另一个类的 Flutter 错误
- docusignapi - 如何在 DocuSign 中为通过 SDK 创建的所有信封和通知设置语言?