Hi Nicolas,
I've modified the order status notification email to include many details from the product, user and order tables.
Although now when I'm testing it appears that the emails are not sent to the user. I can only assume this is due to something I have done with the coding. I have moved a chunk of php code a few lines lower than it was before. Below is a snippet of my code. If I move the PHP code back to where is was then the $data->customer->name; does not return any information. Wondering if you can please shed some light on this?
I would like the emails to be sent to the user, once the status is changed to CONFIRMED.
CODE SNIPPET
<?php
/**
* @package HikaShop for Joomla!
* @version 1.4.5
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license
www.hikashop.com/commercial_license.php
*/
defined('_JEXEC') or die('Restricted access');
?>
<div style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;">
<table style="margin: auto;font-family: Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background-color: #cc3232; padding: 5px;"><img src="images/stories/Newsletters/logo.png" border="0" width="220" height="70" /></td>
</tr>
<tr>
<td><br/>
<?php echo JText::sprintf('HI_CUSTOMER',@$data->customer->name); ?>
<br/>
<br/>
We are pleased to confirm your Beautyscoop purchase.
<br/>
<br/>
To redeem your Scoop, please print the voucher below and bring into store with you, or gift it to a friend.
<br/>
<br/>
</td>
</tr>
<tr>
<td style background="images/stories/Newsletters/voucher_background2.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom"><table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;">Recipient</td>
<td style="color:#555555; font-size:11px; padding-left:10px;"><?php
//displays different Recipient name, based on whether its a gift or not.
$gift = $data->recipient_name;
IF ($gift == ''){
echo "" . $data->customer->name;
}else{
echo "" . $data->recipient_name;
}
?> </td>
</tr>
<tr>
<td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;">Voucher #</td>
<td style="color:#555555; font-size:11px; padding-left:10px;"><?php echo $data->order_id; ?></td>
</tr>
<tr><td>
<?php
$class = hikashop::get('class.order');
$url = $data->order_number;
$config =& hikashop::config();
if($config->get('simplified_registration',0)!=2){
$url .= ' ( '.$data->order_url.' )';
}
$data = $class->get($data->order_id);
$data->cart = $class->loadFullOrder($data->order_id,true,false);
$data->cart->coupon = null;
$price = null;
$tax = 0;
foreach($data->cart->products as $product){
$tax+=round($product->order_product_tax,2)*$product->order_product_quantity;
}
$price->price_value = $data->order_full_price-$tax;
$price->price_value_with_tax = $data->order_full_price;
$data->cart->full_total = null;
$data->cart->full_total->prices = array($price);
$data->cart->coupon->discount_value =& $data->order_discount_price;
?>
</td>
</tr>
<tr>
<td valign="top" style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;">Redeem At</td>
<td style="color:#555555; font-size:11px; padding-left:10px;"><?php
if(hikashop::level(2)){
$fieldsClass = hikashop::get('class.field');
$null = null;
$itemFields = $fieldsClass->getFields('frontcomp',$null,'item');
}
foreach($data->cart->products as $item){
$price = $item->order_product_price*$item->order_product_quantity;
?>
<strong><?php echo $item->order_product_name; ?></strong><?php
if(!empty($itemFields)){
foreach($itemFields as $field){
$namekey = $field->field_namekey;
echo '<p>'.$fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$item->$namekey).'</p>';
}
}
echo '<br />';
$productClass = hikashop::get('class.product');
foreach($data->cart->products as $item){
$productData = $productClass->get($item->product_id);
echo $productData->addressline1 ."<br />";
echo $productData->addressline2 ."<br />";
echo "Phone: ".$productData->phone ."<br />";
echo $productData->website;
}
?>
</td>
</tr>
<tr>
<td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;">Valid From</td>
<td style="color:#555555; font-size:11px; padding-left:10px;"><?php echo $productData->scoop_start_date; ?></td>
</tr>
<tr>
<td style="color:#cc3232; font-size:11px; font-weight:bold; text-align: right;">Valid To</td>
<td style="color:#555555; font-size:11px; padding-left:10px;"><?php echo $productData->scoop_expiry; ?></td>
</tr>
</table></td>
<td style="text-align:right; height:219;"></td>
</tr>
</table>
END CODE SNIPPET