I have added my product id as a key for session cart array. for example 3 and 47.Now when I go to cart page I have text field in where there is quantity box and update button beside it, so I need something when click on update button so it can take it and update the session array of particular product but I can not do this due to product id as a key here is my array
Array
(
[3] => Array
(
[product-id] => 3
[item] => corp
[unitprice] => 90
[quantity] => 3
)
[46] => Array
(
[product-id] => 46
[item] => mike
[unitprice] => 10
[quantity] => 1
)
I've tried using for loop but not working as key does not start form 0,1,2,3 etc. here is my for loop
for($i=0;$i<count($_SESSION['cart']);$i++):
$_SESSION['cart'][$i]['quantity']=$_REQUEST['qty'.$i.''];
endfor;