- Posts: 61
- Thank you received: 1
Customer mail in Order administrator notification
13 years 11 months ago #69766
by Rolandus1
Customer mail in Order administrator notification was created by Rolandus1
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?
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.
13 years 11 months ago #69797
by Xavier
Replied by Xavier on topic Re: Customer mail in Order administrator notification
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:
In this file, and the customer email will be displayed.
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:
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.
13 years 7 months ago - 13 years 7 months ago #90464
by ybe
Replied by ybe on topic Customer mail in Order administrator notification
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 www.hikashop.com/en/forum/3-bug-report/5...tion-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
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 www.hikashop.com/en/forum/3-bug-report/5...tion-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: 13 years 7 months ago by ybe.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90630
by Xavier
Replied by Xavier on topic Customer mail in Order administrator notification
Hi,
You can add it anywhere in the email, it must just be between <?php .. ?> tags.
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.
13 years 7 months ago #91444
by ybe
Replied by ybe on topic Customer mail in Order administrator notification
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.
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('#{(?
}
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('#{(?
}?>
</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.
13 years 7 months ago #91618
by nicolas
Replied by nicolas on topic Customer mail in Order administrator notification
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>';
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.230 seconds