Hola amigo... la verdad reemplace el codigo que tenia por el que me diste... pero no me funciona :(... te voy a pasar los otros archivos para que los pruebes bien y asi veas q paso okis ?
index.php
Código HTML:
<?
include("lib_carrito.php");
?>
<html>
<head>
<title>Trabajando con el carrito</title>
</head>
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<form action="mete_producto.php" method="get">
<input name="id" type="hidden" value="12">
<input name="nombre" type="hidden" value="Silla Modelo Jupiter">
<input name="col" type="hidden" value="Azul">
<input name="tam" type="hidden" value="S">
<input name="precio" type="hidden" value="80">
<th width="50%" height="25" scope="col"><div align="left"><a href="mete_producto.php?id=12&nombre=silla+modelo+jupiter&col=Azul&tam=S&cant=1&precio=80">Silla modelo jupiter 80 euros </a></div></th>
<th width="50%" height="25" scope="col"><div align="right">Cant.
<input name="cant" type="text" id="cant" value="1" size="3" maxlength="3">
<input type="submit" name="Submit" value="Añadir a Carrito">
</div></th>
</form></tr>
<tr>
<th width="50%" height="25" scope="col"><div align="left"><a href="mete_producto.php?id=16&nombre=mesa+camilla+oferta&col=Verde&tam=M&cant=2&precio=29">Mesa camilla en oferta 29 euros</a></div></th>
<th width="50%" height="25" scope="col"><div align="right"></div></th>
</tr>
<tr>
<th width="50%" height="25" scope="col"><div align="left"><a href="mete_producto.php?id=18&nombre=Silla+oficina&col=Gris&tam=XL&cant=1&precio=102">Silla oficina 102 euros</a></div></th>
<th width="50%" height="25" scope="col"><div align="right"></div></th>
</tr>
<tr>
<th width="50%" height="25" scope="col"><div align="left"><a href="mete_producto.php?id=98&nombre=Aparador+cocina+blanco&col=Marron&tam=M&cant=3&precio=200">Aparador cocina blanco 200 euros</a></div></th>
<th width="50%" height="25" scope="col"><div align="right"></div></th>
</tr>
<tr>
<th width="50%" height="25" scope="col"><div align="left">- <a href="ver_carrito.php">Ver carrito</a></div></th>
<th width="50%" height="25" scope="col"><div align="right"></div></th>
</tr>
</table>
</body>
</html>
ver_carrito.php
Código HTML:
<?
include("lib_carrito.php");
?>
<html>
<head>
<title>Introduce Producto</title>
</head>
<body>
<?
$_SESSION["ocarrito"]->imprime_carrito();
?>
<br>
<br>
<a href="index.php">Volver</a>
</body>
</html>
mete_producto.php
Código HTML:
<?
include("lib_carrito.php");
$_SESSION["ocarrito"]->introduce_producto($_GET["id"], $_GET["nombre"], $_GET["col"], $_GET["tam"], $_GET["cant"], $_GET["precio"]);
?>
<html>
<head>
<title>Introduce Producto</title>
</head>
<body>
Producto introducido.
<br>
<br>
<a href="index.php">- Volver</a>
<br>
<br>
<a href="ver_carrito.php">- Ver carrito</a>
</body>
</html>
bueno espero q ahora si puedas dar con lo q te digo... recuerda que lo q basicamente necesito es q no se me dupliquen los registros si no q me actualice las cantidades y precios si ya el producto existe dentro de la SESSION...
GRACIAS