Código:
<?php // Manual de PHP
session_start();
session_register('itemsEnCesta');
$item=$_POST['item'];
$cantidad=$_POST['cantidad'];
$itemsEnCesta=$_SESSION['itemsEnCesta'];
if ($item){
if (!isset($itemsEnCesta)){
$itemsEnCesta[$item]=$cantidad;
}else{
foreach($itemsEnCesta as $k => $v){
if ($item==$k){
$itemsEnCesta[$k]+=$cantidad;
$encontrado=1;
}
}
if (!$encontrado) $itemsEnCesta[$item]=$cantidad;
}
}
$_SESSION['itemsEnCesta']=$itemsEnCesta;
?>
Buenas tengo este codigo y quiero agregar un valor mas, tengo item y tengo cantidad, quisiera agregar precio y otras cosas mas, la verdad me he confundido, porfavor arreglene este codigo o diganme como le agrego una mas PLEASE!!!