View Single Post
  #5  
Old 09-14-2009, 04:50 AM
  ElegantXMods.com's Avatar 
ElegantXMods.com ElegantXMods.com is offline
 

Advanced Member
  
Join Date: Apr 2009
Location: Stirling, UK
Posts: 94
 

Default 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);

?>
__________________
John
ElegantXMods.com

QuickOrder AJAX-based search and ordering system now available
giving you complete control over how customers browse and search for your products. Click here for details.
PriceSlider - easily filter categories by price range - only $9.99 - details here

X-Cart 4.1, X-Cart 4.2 on Windows/IIS and Linux/Apache.
Reply With Quote