guardar carrito de compra en la bd
Publicado por john (5 intervenciones) el 27/08/2018 21:59:31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<th align="right">Nombre:</th>
<th><label for="nombre"></label>
<input type="text" name="nombre" id="nombre" size="50" value="<?php echo $_SESSION["usuario"]; ?>" required></th>
<td> </td>
<td height="39"> </td>
<td align="right">E-Mail:</td>
<td><label for="email"></label>
<input type="email" name="email" id="email" size="50" required></td>
<td> </td>
<?php
if(isset($_SESSION['carrito'])){
$total=0;
for($i=0;$i<=count($compras)-1;$i++){
if($compras[$i]!=NULL){ ?>
<tr>
<td width="300"><?php echo $compras[$i]['nombre']; ?></td>
<td width="200">$<?php echo $compras[$i]['precio']; ?></td>
<td width="200"><?php echo $compras[$i]['cantidad'];?></td>
<td width="200">$
<?php echo $compras[$i]['cantidad'] * $compras[$i]['precio'];?>
</td>
</tr width="200">
<?php
$total= $total+($compras[$i]['cantidad'] * $compras[$i]['precio']);
}
}
}
?>
<td width="100"><p>TOTAL A PAGAR::</p></td>
<td width="100"><p><?php if(isset($_SESSION['carrito'])){ echo "$ ".$total." Dolares ";}?></p>
<input type="submit" name="button" id="button" value="enviar_pedido"><br>
<input type="button" name="imprimir" value="Imprimir pedido" onclick="window.print();"></td>
Valora esta pregunta
0