Customer mail in Order administrator notification

  • Posts: 61
  • Thank you received: 1
12 years 3 months ago #69766

Hi
In the mail "Order administrator notification" send to admin, there is no e-mail adress of the client.
We need that.

It could appear with the billing or the shipping adress below the price table.
Or even better, if the e-mail adress could be the sender FROM adress of the mail.

Are both ways possible?
If yes how to?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 3 months ago #69797

Hi Rolandus1,

To have the customer email in the order administrator notification, you just have to edit the mail "Order administrator notification" in HikaShop > System > Emails, and add the code:

echo $data->customer->email;

In this file, and the customer email will be displayed.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 10 months ago #90464

Hi:

I am not seeing this place to edit the email in HikaShop > System > Emails

System menu - yes
E-mails tab - yes; but only for high level address, embed information

Where do I add this 'customer email address' to the 'Order Administration Notification' email?

Please Note: I also saw this post http://www.hikashop.com/en/forum/3-bug-report/5325-administrator-order-creation-notification-email.html#5325 and looked at editing the file media/com_hikashop/mail/order_admin_notification.text.php but am not sure where to add it (PHP is not my skill set...).

Thanks for your help

Last edit: 11 years 10 months ago by ybe.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #90630

Hi,

You can add it anywhere in the email, it must just be between <?php .. ?> tags.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 10 months ago #91444

Hi Xavier

Thanks but that does not help me understand so some more questions.

1. I have to change

order_admin_notification.html.php
AND
order_admin_notification.text.php

Correct? And these are the generators for the HTML and Text emails respectively, correct?

2. If so, I see this section in the html.php file


<tr>
<td>
<table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;">
<?php
$params = null;
$js = '';
$fieldsClass = hikashop_get('class.field');
$app=&JFactory::getApplication();
$template = trim(hikashop_getLayout($app->isAdmin() ? 'order' : 'address','address_template',$params,$js));
if(!empty($data->cart->billing_address)){
$billing = $template;
foreach($data->cart->fields as $field){
$fieldname = $field->field_namekey;
$billing=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$data->cart->billing_address->$fieldname),$billing);
}
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_BILLING_ADDRESS').'</td></tr><tr><td>';
echo str_replace(array("\r\n","\r","\n"),'<br/>',preg_replace('#{(?:(?!}).)*}#i','',$billing)).'<br/></td></tr>';
}
if(!empty($data->cart->order_shipping_id) && !empty($data->cart->shipping_address)){
$shipping = $template;
foreach($data->cart->fields as $field){
$fieldname = $field->field_namekey;
$shipping=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$data->cart->shipping_address->$fieldname),$shipping);
}
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'</td></tr><tr><td>';
echo str_replace(array("\r\n","\r","\n"),'<br/>',preg_replace('#{(?:(?!}).)*}#i','',$shipping)).'<br/></td></tr>';
}?>
</table>
</td>
</tr>

Presumably the line:

echo $data->customer->email;

Needs to go within the <table> and needs to be include a <tr><td> like this:

echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">$data->customer->email</td></tr><tr><td>';

Is that the correct syntax?

If it is the correct syntax do I just add it under the lines:

echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_BILLING_ADDRESS').'</td></tr><tr><td>';
AND
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'</td></tr><tr><td>';

To cover which address it puts in the email?

3. In the text.php file I absolutely cannot figure out where to put it (assuming it needs it...). There are only <?php .. ?> tags in the header; the second <?php does not close.

Can you provide more direction?

Thanks for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13412
  • MODERATOR
11 years 10 months ago #91618

Hi,

You mainly need to change the HTML version. Almost all the email clients use the HTML version and yours too. So you don't need to modify the text version.

It should be:
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.$data->customer->email.'</td></tr><tr><td>';

and not:
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">$data->customer->email</td></tr><tr><td>';

And yes, you can add it after:
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_BILLING_ADDRESS').'</td></tr><tr><td>';

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum