My multidimensional shopping cart will not remove an item from the basket. I read in the manual that unset() operates on a copy of the array in question within a function, but am a little lost because this is directly from the script....
//in a doubled "for" loop
if ($qty=='0') {
//debug stuff here
//echo "quantity was zero...<br>$color = color<br>D is $d<br><br>";
unset($_SESSION['cart']['$d']['qty']);
// again...echo "qty should be unset<br>";
unset($_SESSION['cart']['$d']['size']);
unset($_SESSION['cart']['$d']['price']);
unset($_SESSION['cart']['$d']['color']);
unset($_SESSION['cart']['$d']['sku']);
unset($_SESSION['cart']['$d']);
}
My first thought was that one "unset()" should do it (the last one...) but my output is still showing the same number of entries in the cart. Hmm, I am using a function to do the output...
Any thoughts?