sophielois
Technical User
Hi guys and galls,
well im stuk.
Im using a custom shopping cart me and a friend have been working on.
Im trying to send an email to the customer services giving details of what products have been ordered.
here's how the orderd products are displayed onscreen
and here's my current code to send the email to the customer service rep
The email works fine, but i cant work out what i need to put next to products: so that it displays all the ordered products?
Thanks if you can help me,
Sophster
well im stuk.
Im using a custom shopping cart me and a friend have been working on.
Im trying to send an email to the customer services giving details of what products have been ordered.
here's how the orderd products are displayed onscreen
Code:
<div id="pi" style="width:597px;">Product Information <a href="cart.php">edit</a></div>
<table width="98%" border="0" align="center">
<tr>
<td align="left"><strong>ID</strong></td>
<td align="center"><strong>Product</strong></td>
<td align="center"><strong>Qty</strong></td>
<td style="text-align:right;" align="right"><div align="right"><strong>Price</strong></div></td>
<td style="text-align:right;" align="right"><div align="right"><strong>Total</strong></div></td>
</tr>
<?
$alternate = false;
foreach ($invoice->cart->items as $id => $item) {
$alternate = !$alternate;
?>
<tr class="<?= $alternate ? "a" : "b" ?>">
<td>
<?=$id?>
</td>
<td align="center">
<?=$item->name?>
</td>
<td align="center">
<?=$item->qty?>
</td>
<td class="currency" align="right"> £
<?=number_format($item->price, 2)?>
</td>
<td class="currency" align="right"> £
<?=number_format($item->extendedPrice(), 2)?>
</td>
</tr>
<? } ?>
<tr class="b">
<td colspan="4" align="right">FREE DELIVERY</td>
<td class="currency" align="right">£0</td>
</tr>
<tr class="b">
<td colspan="4" align="right"><strong>TOTAL</strong></td>
<td class="currency" align="right"> £
<?=number_format($invoice->getTotal(), 2)?>
</td>
</tr>
</table>
and here's my current code to send the email to the customer service rep
Code:
$mailContent="$name has orderd the following products\n\n
Name: $name
Products:";
$toAddress="mee@mydomain.com";
$subject="Product Order";
$recipientSubject="Order from Website";
$receiptMessage = "Thank you $name for your online order we will contact you shortly\n\nThis is an automated email please do not respond";
mail($invoice->customer->email, $subject, $receiptMessage,"From:$toAddress");
mail($toAddress,$recipientSubject,$mailContent,"From:$email");
The email works fine, but i cant work out what i need to put next to products: so that it displays all the ordered products?
Thanks if you can help me,
Sophster