Las variables e información del cart.php
<?php
$items = (isset($_SESSION['cart']) && is_array($_SESSION['cart'])) ? $_SESSION['cart'] : array();
$itemCount = count($items);
$qty = (isset($_SESSION['qty']) && is_array($_SESSION['qty'])) ? $_SESSION['qty'] : array();
$total = 0;
$num = 1;
$meQty = 0;
$itemId = "";
$meCount = $itemCount;
foreach ($qty as $id_pro => $valueqty) {
$meQty = $meQty + $valueqty;
}
foreach ($items as $id_pro => $item){
$itemId = $itemId . $item . ",";
}
<div class="basket">
<div class="basket-labels">
<ul>
<li class="basket-item item-heading">Item</li>
<li class="basket-price">Price</li>
<li class="basket-quantity">Quantity</li>
<li class="basket-subtotal">Subtotal</li>
</ul>
</div>
<?php
while ($stmt->fetch()) {
$key = array_search($id_pro, $items);
$total = $total + $price * $qty[$key];
?>
<div class="basket-product">
<div class="basket-item">
<div class="product-image">
<?php echo '<img class="product-frame" src="assets/img/upload/image/'.$image.'" alt="'.$product.'" /> ';?>
</div>
<div class="product-details">
<h2><?php echo $product;?></h2>
</div>
</div>
<div class="basket-price">$<?php echo number_format($price,2);?></div>
<div class="basket-quantity">
<?php echo $qty[$key];?>
</div>
<div class="basket-subtotal"><?php echo number_format(($price * $qty[$key]),2); ?></div>
<div class="basket-remove-item">
<a href="removecart.php?itemId=<?php echo $id_pro; ?>">Remove</a>
</div>
</div>
<?php
$num++;
}
?>
</div>