macmonkey
10-02-2006, 08:50 PM
I've got a small shopping cart that has items stored in an Array.
Array ( [0] => Array ([0]=> 1234 [1] => 4 [2] => 3) [1] => Array ( [0] => 2640 [1] => 9 [2] => 1 ) [2] => Array ( [0] => 2885 [1] => 20 [2] => 1 ) )
My problem is that when I print the order out in the shopping cart I use a foreach loop and simply post the "remove" link to a query string with an incremented value 0,1,2,3 etc...
When someone clicks to remove the very first item it removes the first array item but leaves the rest:
Array ( [1] => Array ( [0] => 2640 [1] => 9 [2] => 1 ) [2] => Array ( [0] => 2885 [1] => 20 [2] => 1 ) )
Now my remove buttons don't work because the incremented variable is off.
Any ideas on how to chage this new array so that the first item is associated with [0] instead of [1]
Thanks!
Array ( [0] => Array ([0]=> 1234 [1] => 4 [2] => 3) [1] => Array ( [0] => 2640 [1] => 9 [2] => 1 ) [2] => Array ( [0] => 2885 [1] => 20 [2] => 1 ) )
My problem is that when I print the order out in the shopping cart I use a foreach loop and simply post the "remove" link to a query string with an incremented value 0,1,2,3 etc...
When someone clicks to remove the very first item it removes the first array item but leaves the rest:
Array ( [1] => Array ( [0] => 2640 [1] => 9 [2] => 1 ) [2] => Array ( [0] => 2885 [1] => 20 [2] => 1 ) )
Now my remove buttons don't work because the incremented variable is off.
Any ideas on how to chage this new array so that the first item is associated with [0] instead of [1]
Thanks!