A ver si alguien me puede decir por qué al recibir el mail solo me aparece el contenido de la variable suma. Es decir, la tabla donde tengo el pedido no me sale. Es quizás por algun problema de trabajo con las sesiones. Gracias
function manda_carrito(){
$cuerpo="";
$headers_mensaje = "From:
correo@dominio.com\r\n" . "Reply-To:
correo@dominio.com\r\n" . "Return-path:
correo@dominio.com\r\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1";
$cuerpo = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
'.$suma = 0;
echo '<table border=0 cellpadding="5">
<tr>
<td><b>Código</b></td>
<td><b>Cantidad</b></td>
<td><b>Nombre producto</b></td>
<td><b>Precio</b></td>
<td><b>Total</b></td>
<td> </td>
</tr>';
for ($i=0;$i<$this->num_productos;$i++){
if($this->array_id_prod[$i]!=0){
echo '<tr>';
echo "<td>" . $this->array_id_prod[$i] . "</td>";
echo "<td>" . $this->array_cant_prod[$i] . "</td>";
echo "<td>" . $this->array_nombre_prod[$i] . "</td>";
echo "<td>" . $this->array_precio_prod[$i] . "</td>";
echo "<td>" . $this->array_precio_prod[$i]*$this->array_cant_prod[$i] . "</td>";
//echo "<td><a href='eliminar_producto.php?linea=$i'>Eliminar producto</td>";
echo '</tr>';
$suma += $this->array_precio_prod[$i]*$this->array_cant_prod[$i];
}
}
//muestro el total
echo "<tr><td></td><td></td><td><b>TOTAL:</b></td><td> </td><td><b>$suma</b></td><td> </td></tr>";
//total más IVA
echo "<tr><td></td><td></td><td><b>IVA (7%):</b></td><td></td><td> <b>" . $suma * 1.07 . "</b></td><td> </td></tr>";
echo "<tr><td></td><td></td><td><b>R.E.(7%+1%):</b></td><td></td><td> <b>" . $suma * 1.08 . "</b></td><td> </td></tr>";
echo "</table>"; '
</body>
</html>
';
mail("XXXXXX@telefonica.net","Nuevo Pedido",$cuerpo,$headers_mensaje);
}