Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/02/2010, 21:31
Avatar de jival
jival
 
Fecha de Ingreso: noviembre-2007
Mensajes: 173
Antigüedad: 16 años, 5 meses
Puntos: 0
Respuesta: Como envio la cantidad ?

Esa es la pregunta amigo , pues redulta que en la pagina vercarrito.php se puede hacer eso pero yo lo quiero hacer en el catalogo, te dejo el codigo completo de vercarrito.php donde nada pongo en el campo de texto la cantidad e inmediatamente actuliza los datos, como es eso posuble no lo se por eso estoy aqui

vercarrito.php

<?php
session_start();
error_reporting(E_ALL);
@ini_set('display_errors', '1');
if(isset($_SESSION['carro']))
$carro=$_SESSION['carro'];else $carro=false;
?>
<html>
<head>
<title>PRODUCTOS AGREGADOS AL CARRITO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.tit {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #FFFFFF;
}
.prod {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #333333;
}
h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
color: #990000;
}
-->
</style>
</head>

<body>

<h1 align="center">DETALLE CARRITO</h1>
<?php
if($carro){
?>
<table width="774" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#333333" class="tit">
<td width="140">Producto</td>
<td width="210" align="center">Descripci&oacute;n</td>
<td align="center">Precio </td>
<td align="center">Cantidad deUnidades</td>
<td align="center">&nbsp;</td>
<td width="52" align="center">Borrar</td>
<td width="78" align="center">Actualizar</td>
</tr>
<?php
$color=array("#ffffff","#F0F0F0");
$contador=0;
$suma=0;
foreach($carro as $k => $v){
$subto=$v['cantidad']*$v['precio'];
$suma=$suma+$subto;
$contador++;
?>
<form name="a<?php echo $v['identificador'] ?>" method="post" action="agregacar.php?<?php echo SID ?>" id="a<?php echo $v['identificador'] ?>">
<tr bgcolor="<?php echo $color[$contador%2]; ?>" class='prod'>
<td><?php echo $v['producto'] ?></td>
<td bgcolor="<?php echo $color[$contador%2]; ?>"><?php echo $v['detalle'] ?></td>
<td width="92" align="center"><?php echo $v['precio'] ?></td>
<td width="115" align="center"><?php echo $v['cantidad'] ?></td>
<td width="87" align="center" class="prod"><input name="cantidad" type="text" id="cantidad" value="<?php echo $v['cantidad'] ?>" size="1"> <input name="id" type="hidden" id="id" value="<?php echo $v['id'] ?>"> </td>
<td align="center"><a href="borracar.php?<?php echo SID ?>&id=<?php echo $v['id'] ?>"><img src="trash.gif" width="12" height="14" border="0"></a></td>
<td align="center">
<input name="imageField" type="image" src="actualizar.gif" width="20" height="20" border="0"></td>
</tr></form>
<?php }?>
</table>
<div align="center"><span class="prod">Total de Artículos: <?php echo count($carro); ?></span>
</div><br>
<div align="center"><span class="prod">Total: &cent; <?php echo number_format($suma,2); ?></span>
</div><br>
<div align="center"><span class="prod">Continuar la selección de productos</span>
<a href="catalogo.php?<?php echo SID;?>"><img src="continuar.gif" width="13" height="13" border="0"></a>
</div>

<?php }else{ ?>
<p align="center"> <span class="prod">No hay productos seleccionados</span> <a href="catalogo.php?<?php echo SID;?>"><img src="continuar.gif" width="13" height="13" border="0"></a>
<?php }?>
</p>
</body>
</html>