I'm building my own cart, not liking others, and besides, I figured I ought to learn how. If I call unset() on the first item in the cart, I often get this....
There are not any items in your cart!!
var_dump($_SESSION):
array(3) { ["total_price"]=> float(0) ["items"]=> int(0) ["cart"]=>
array(1) { [1]=> array(5) { ["sku"]=> string(11) "HS-HNRC-NVY"
["color"]=> string(4) "Navy" ["size"]=> string(1) "S" ["qty"]=>
string(1) "2" ["price"]=> string(5) "44.95" } } }
The issue is to be that the "cart" array, which is integer indexed, sees nothing in position 0, and my code then tells it the cart is empty. What's the standard way of handling this? Do I need to write the cart so it doesn't care if the array has empty portions (I think that currently it would output blank table rows!!), or is there an elegant method? I've been messing around with array_shift(), and thought I had it a couple of hours ago, but then I went to adjust the HTML "look" and seem to have borked it again...TIA for any thoughts.....