Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/03/2008, 09:16
pavie
 
Fecha de Ingreso: julio-2007
Mensajes: 24
Antigüedad: 16 años, 10 meses
Puntos: 0
Re: Problema carrito de la compra

De acuerdo, te pongo el código íntegro de la función php que hace referencia cuando se pulsa al botón " Comprar "

<?php
//echo "./index.php?op=biblioteca&id=".$tipo."<br>";

if (isset($COMPRA))
{
//echo "./index.php?op=biblioteca&id=".$tipo."<br>";
$Direccion="./index.php?op=biblioteca&id=".$tipo;

$Nuevo_Producto=count($carrito);

$carrito[$Nuevo_Producto][0]=$registro['bib_id'];
$carrito[$Nuevo_Producto][1]=$txt_unidades;
$carrito[$Nuevo_Producto][2]=$registro['bib_pvp_socio'];
$carrito[$Nuevo_Producto][3]=$registro['bib_pvp_no_socio'];
$carrito[$Nuevo_Producto][4]="SI";
unset($txt_codigo);

//echo "REFERENCIA: ".$carrito[$Nuevo_Producto][0]."<br>";
//echo "UNIDADES: ".$carrito[$Nuevo_Producto][1]."<br>";
//echo "PRECIO: ".$carrito[$Nuevo_Producto][2]."<br>";
//echo "PRECIO NO: ".$carrito[$Nuevo_Producto][3]."<br>";
//echo "ACTIVO: ".$carrito[$Nuevo_Producto][4]."<br>";
?>
<script>
location.href='./index.php?op=biblioteca&id=PEDIDOS';
</script>


<?php
}
else
{
$ESTA='NO';
for ($Indice=1;$Indice<count($carrito);$Indice++)
{
//echo $carrito[$Indice][0]."<br>";
if ($carrito[$Indice][0]==$registro['bib_id'])
{
$ESTA='SI';
}
}

if ($ESTA=='NO')
{
?>
<form name="form1" method="post" action="./index.php?op=biblioteca&id=MOSTRAR&art=<?php echo $art; ?>&COMPRA=SI&tipo=<?php echo $tipo; ?>">
<table width="100%" border="0" cellspacing="3" background="imagenes_botones/fondo_compra.jpg">
<tr>
<td align="left" valign="middle"><span class="Nombre_Articulo">Unidades</span>
<select name="txt_unidades" class="inputs" id="txt_unidades">
<?php
for ($indice=99;$indice>=1;$indice--)
{
?>
<option selected><?php echo $indice; ?></option>
<?php
}
?>
</select></td>
<td width="50%" align="right" valign="middle">
<input name="Submit" type="image" value="Enviar" src="imagenes_botones/btn_comprar.gif" alt="Comprar Articulo." width="210" height="43">
</td>
</tr>
</table>
</form>
<?php
}
else
{
?>
<table width="100%" border="0" cellspacing="0">
<tr>
<td align="center" valign="middle" background="imagenes_botones/fondo_compra.jpg">
<img src="imagenes_botones/comprado.gif" alt="COMPRADO" width="147" height="60" border="0">
</td>
</tr>
</table>
<?php
}
}
?>

Espero sirva para que me puedan ayudar
Gracias por todo :)