Mandar por Mail el Carro de Compras
Publicado por Johanna (13 intervenciones) el 24/07/2018 03:45:25
Hola chicos! Vengo a pedirles ayuda!
Tengo este código de mi carro de compras que funciona bárbaro, pero no se como mandarlo por mail :(
Me ayudan??
Graciassssssssssssss

Tengo este código de mi carro de compras que funciona bárbaro, pero no se como mandarlo por mail :(
Me ayudan??
Graciassssssssssssss
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
// connect to database
include 'config/database.php';// to prevent undefined index notice
$action = isset($_GET['action']) ? $_GET['action'] : "";
$product_id = isset($_GET['product_id']) ? $_GET['product_id'] : "1";
$name = isset($_GET['name']) ? $_GET['name'] : "";
$foto = isset($_GET['foto']) ? $_GET['foto'] : "";
$medida = isset($_GET['medida']) ? $_GET['medida'] : "";
$quantity = isset($_GET['quantity']) ? $_GET['quantity'] : "1";
// page headers
$page_title="Carrito";
// parameters
$action = isset($_GET['action']) ? $_GET['action'] : "";
$name = isset($_GET['name']) ? $_GET['name'] : "";
// display a message
if($action=='removed'){
echo "<h4><div class='fa fa-gear'>"; echo "<strong>{$name}</strong> fue eliminado del carrito!</h4><br>"; echo "</div>";}else if($action=='quantity_updated'){
echo "<h4><div class='fa fa-gear'> "; echo "<strong>{$name}</strong> la cantidad ha sido actualizada!</h4><br>"; echo "</div>";}else if($action=='failed'){
echo "<h4><div class='fa fa-gear'>"; echo "<strong>{$name}</strong> no se pudo actualizar la cantidad!</h4><br>"; echo "</div>";}else if($action=='invalid_value'){
echo "<h4><div class='fa fa-gear'>"; echo "<strong>{$name}</strong> cantidad es inválida!</h4><br>"; echo "</div>";}// select products in the cart
$query="SELECT p.id, p.name, p.price, ci.quantity, ci.quantity * p.price AS subtotal
FROM cart_items ci
LEFT JOIN products p
ON ci.product_id = p.id";$stmt=$con->prepare( $query );
$stmt->execute();
// count number of rows returned
$num=$stmt->rowCount();
if($num>0){
//start table
echo "<table class='table table-hover table-responsive table-bordered'>"; // our table heading
echo "<tr>"; echo "<th class='textAlignLeft'>Nombre del producto</th>"; echo "<th>Precio ($ Arg)</th>"; echo "<th style='width:15em;'>Cantidad</th>"; echo "<th>Sub Total</th>"; echo "<th>Acciones</th>"; echo "</tr>"; $total=0;while( $row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
echo "<tr>"; echo "<td>"; echo "<div class='product-id' style='display:none;'>{$id}</div>"; echo "<div class='product-name'>{$name}</div>"; echo "</td>";echo "<td>$" . number_format($price, 2, '.', ',') . "</td>";
echo "<td>"; echo "<div class='input-group'>"; echo "<input type='number' name='quantity' value='{$quantity}' class='form-control'>"; echo "<span class='input-group-btn'>"; echo "<button class='btn btn-info update-quantity' type='button'><i class='fa fa-cog'></i> Actualizar</button>"; echo "</span>"; echo "</div>"; echo "</td>";echo "<td>$" . number_format($subtotal, 2, '.', ',') . "</td>";
echo "<td>"; echo "<a href='eliminar.php?id={$id}&name={$name}' class='btn btn-danger'>"; echo "<span class='fa fa-trash'></span> Quitar"; echo "</a>"; echo "</td>"; echo "</tr>";$total += $subtotal;
} echo "<tr>"; echo "<td><b>Total</b></td>"; echo "<td></td>"; echo "<td></td>";echo "<td>$" . number_format($total, 2, '.', ',') . "</td>";
echo "<td>"; echo "<a href='enviarcarro.php?id={$id}' class='btn btn-success'>"; echo "<span class='fa fa-envelope'></span> Pedir"; echo "</a>"; echo "</td>"; echo "</tr>"; echo "</table>";}else{
echo "<div class='alert alert-danger'>"; echo "<strong>No se han encontrado productos</strong> en tu carrito!"; echo "</div>";}?>
Valora esta pregunta


0
