Each
<form>
is posting a single quantity. But there is nothing in that form to indicate which row it belongs to, so you end up applying the new quantity to every row.
You need to add an
<input type="hidden">
to the form with the value of a field which identifies the row from your cart. For example:
echo '<form method="POST" action"">';
echo '<input type="hidden" name="broodnaam" value="' . $row['broodnaam'] . '">';
echo '<div class="col-xs-4">';
echo '<input type="number" name="quantity" id="quantity" class="form-control input-sm" placeholder="1" min="1" value="1">';
echo '</div>';
echo '</form>';
You then need to test that value to see if the new quantity applies to the current row.
$quantity = 1;
if (isset($_POST['quantity']) && !empty($_POST['quantity'])){
if (isset($_POST['broodnaam']) && !empty($_POST['broodnaam'])){
if ($_POST['broodnaam'] == $row['broodnaam']){
$quantity = $_POST['quantity'];
}
}
}
echo '<div class="cart-item cart-column">';
$rowtotaal = $row['prijs'] * $quantity;
$sumtotal += $rowtotaal;
echo $rowtotaal;
echo '</div>';
NB: You don't appear to be storing the quantity anywhere on the cart. If the user updates the quantity of "pants" to 2, and then updates the quantity of "shoes" to 2, the quantity of "pants" will be reset to 1.