if i were you i were make a database, a table for the items. You can insert an order-by field to store an order for this form. The quantities and item names and the ID field would be enought to process the selection.
the while cycle would be to make the checkboxes and get the quantities:
$items_id_hash=sha1($items_id);
$item_name ($item_prize):<input type="checkbox" name="order[$items_id]" value="1"><input type="text" name="quantity[$items_id]">
<input type="hidden" name="item_name[$items_id_hash]" value="$item_name">
<input type="hidden" name="item_pr[$items_id_hash]" value="$item_prize">
how to get the selected ID's:
$prize=0;
$q=0;
foreach($_POST["order"] AS $keys)
{
$items_id_hash=sha1($keys);
$names[]=$_POST["item_name"][$items_id_hash];
$prize+=$_POST["item_pr"][$items_id_hash] * (int)$_POST["quantity"][$keys];
$q+=(int)$_POST["quantity"][$keys];
}
printf("You have selected: %s (%d) total=%d (\$)" , implode(",",$names) , $q, $prize );
its just an example how to associate ID fields with form inputs. The prize and quantity names should selected from the database based on the POSTed $_POST["order"] ID's. Never trust incoming data from a user, such as item details.