Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/11/2011, 11:20
pkoozita_16
 
Fecha de Ingreso: septiembre-2011
Mensajes: 2
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: Guardar carrito de compras en BD

Este es el código en el que muestro los datos del carrito y de aquí mando a la siguiente pagina que es en donde guardo...

Código PHP:
<?PHP
if($carro)
{  
?> 
<div align="center"><p><a href=Busqueda_articulos.php>
<strong>Seleccionarotro Producto</strong></a>&nbsp;
<a href=mostrar.php><strong>Mostrar Pedido</strong></a></p>
</div> 
                                            
<table width="720" Border=3 align=Center bordercolor=#145871> 
<tr class="tit">  
<td >Articulo</td>
<td >Nombre</td>            
<td >Precio MN</td> 
<td >Precio DLLS</td> 
<td >Cantidad de Unidades</td> 
<td >Borrar</td>  
</tr> 
<?php 
                                        
$suma
=0
$suma_dlls=0;
foreach(
$carro as $k => $v)
{
$subto=$v['cantidad']*$v['precio_me'];                                                     
$suma=$suma+$subto;     
$subto_dlls=$v['cantidad']*$v['precio'];                                                 
$suma_dlls=$suma_dlls+$subto_dlls;
                                                    

?> 
<tr>  
<td><?php echo $v['articulo'?></td> 
<td><?php echo $v['nombre_articulo'?></td> 
<td><?php echo $v['precio_me'?></td> 
<td><?php echo $v['precio'?></td>
<td ><?php echo $v['cantidad'?></td> 
<td><input name="cantidad" type="text" id="cantidad" value="<?php echo $v['cantidad'?>" size="8">                                                               <input name="id" type="hidden" id="id" value="<?php echo $v['folio'?>"></td> 
<td><a href="borracar.php?id=<?php echo $v['folio'?>"></td>  
</tr>

<?php   
}     
?> 
</table> 

<p>Total a Pagar: $</span><?php echo number_format($suma,2);?></p>
<p>Total a Pagar Dlls: $</span><?php echo number_format($suma_dlls,2);?</p>
 
<?
php 
}
else
{  
echo 
"No hay productos seleccionados"

}
?>