Probá agregando este método a la clase y llamándolo de la misma manera que invocás al método que imprime el carrito, pero agregándole estos parámetros: $nombreempresa,$emailempresa,$emailcliente
Código PHP:
<?php
function mail_carrito($nombreempresa,$emailempresa,$emailcliente){
$suma = 0;
$html= '<table border=1 cellpadding="3">
<tr>
<td><b>Nombre producto</b></td>
<td><b>Precio</b></td>
<td> </td>
</tr>';
for ($i=0;$i<$this->num_productos;$i++){
if($this->array_id_prod[$i]!=0){
$html.= '<tr>';
$html.= "<td>" . $this->array_nombre_prod[$i] . "</td>";
$html.= "<td>" . $this->array_precio_prod[$i] . "</td>";
$html.= "<td><a href='eliminar_producto.php?linea=$i'>Eliminar producto</td>";
$html.= '</tr>';
$suma += $this->array_precio_prod[$i];
}
}
$html.= "<tr><td><b>TOTAL:</b></td><td> <b>$suma</b></td><td> </td></tr>";
//total más IVA
$html.= "<tr><td><b>IVA (16%):</b></td><td> <b>" . $suma * 1.16 . "</b></td><td> </td></tr>";
$html.= "</table>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset= iso-8859-1\r\n";
$headers .= "Reply-To: ".$emailempresa."\r\n";
$headers .= "From: ".$nombreempresa." <".$emailempresa.">\r\n";
if(mail($emailcliente,"Detalle de su compra en".$nombreempresa,$html,$headers)){$mensaje="Mensaje enviado correctamente";}else{$mensaje="El mensaje no pudo enviarse";}
echo $mensaje;
}
?>