I made a shopping cart for people to order products. The products are added perfect. So i made a ‘remove’ button. But since i implemented the ‘remove’ button, the first result is not showing. The second and third are showing up. If i comment out the remove form, everything is showing, but you cant remove..
What am I doing wrong?
<div style="clear: both"></div>
<h3 class="title 2">Shopping Cart Details</h3>
<div class="table-responsive">
<table class="table table-bordered">
<tr>
<th width="30%">SKU</th>
<th width="20%">Item Description</th>
<th width="20%">Quantity</th>
<th width="30%">Remove Item</th>
</tr>
<?php
if (!empty($_SESSION['cart'])) {
foreach ($_SESSION['cart'] as $key => $value)
{
?>
<tr>
<td><?php echo $value['SKU']; ?></td>
<td><?php echo $value["item_description"]; ?></td>
<td><?php echo $value['quantity']; ?></td>
<!-- remove form -->
<!-- <form action="lijstweergave.php?action=remove&SKU=<?php // echo $value['SKU']; ?>" method="post">
<input type="hidden" name="remove_SKU" value="<?php // echo $value['SKU']; ?>">
<input type="submit" name="remove_item" value="Remove">
</form> -->
</tr>
<!-- end remove form -->
<?php
}
}
?>
</table>
</div>
</div>`
I tried putting the code out of the loop, commenting out change the format.