Re: Email cart contents?
Not tested this, but it should be pretty close to what you want:
<?php
require "./auth.php";
x_load('cart');
$html = "
<body>
<h2>Date: ". date(DATE_RFC822) ."</h2>
<table>
<tr>
<th>Product Code</th>
<th>Product Name</th>
<th>Price (". $config["General"]["currency_symbol"] .")</th>
<th>Qty</th>
<th>Subtotal (". $config["General"]["currency_symbol"] .")</th>
</tr>";
for ($i = 0; $i < $cart["max_cartid"]; $i++){
$html .= "<tr>
<td>". $cart["products"][$i]["productcode"] ."</td>
<td>". $cart["products"][$i]["product"] ."</td>
<td>". $cart["products"][$i]["price"] ."</td>
<td>". $cart["products"][$i]["amount"] ."</td>
<td>". $cart["products"][$i]["display_subtotal"] ."</td>
</tr>";
}
$html .= "</table>
<table>
<tr>
<td>Subtotal (". $config["General"]["currency_symbol"] .")</td>
<td>". $cart["subtotal"] ."</td>
</tr>
<tr>
<td>Discount (". $config["General"]["currency_symbol"] .")</td>
<td>". $cart["discount"] ."</td>
</tr>
<tr>
<td>Taxes: (". $config["General"]["currency_symbol"] .")</td>
<td>". $cart["tax_cost"] ."</td>
</tr>
<tr>
<td><b>Total (". $config["General"]["currency_symbol"] .")</b></td>
<td><b>". $cart["display_discounted_subtotal"] ."</b></td>
</tr>
</table>
</body>";
mail ("from@domain.com", "to@domain.com", "Subject Line", $html);
?>
|