Forum Moderators: coopster
I maked an session and stored 2 variables in it $item(Product) and $aantal(ammount) when I excecute it I get only the $aantal and the $item variable on my screen I tried now for a week to get more variables stored in the session. For example I have the following output
Aantal Productomschrijving Prijs Boter Extra
12 Kaas
15 Rosbief
Now you can see what i`m missing I want it to be like this:
Aantal Productomschrijving Prijs Boter Extra
12 Kaas 1.25 ja niets
15 Rosbief 2.50 nee Peper
The array looks like this now:
Array ( [Bal gehakt] => 12 [Belegen kaas] => 15 [Verse jus d`orange, 0,25 liter] => 0 [Jonge kaas] => 15 [Cola, blikje] => 0 [Brie] => 2 )
and it`s should look something like this:
Array ( [Bal gehakt] => 12,1.25,ja,niets [Belegen kaas] => 15,2.25,nee,peper [Verse jus d`orange, 0,25 liter] => 0 [Jonge kaas] => 15 [Cola, blikje] => 0 [Brie] => 2 )
I hope this is clear. If you need more info say it
[edited by: coopster at 12:49 pm (utc) on Mar. 15, 2005]
[edit reason] removed irrelevant code [/edit]
It may not be very elegant, but I just stuck everything together with a delimiter between.
That way it is a 1 dimensional array, the key being the item name, price, etc; the value being the qty purchased.
$uniqueitem=$sku.'`'.$uosid.'`'.$opt; //construct the array key
$_SESSION['cart'][$uniqueitem]=$qty;
if($qty=='0')
unset($_SESSION['cart'][$uniqueitem]);