- Posts: 30
- Thank you received: 2
Product Name, Cust. Name to Subject Admin Email
12 years 4 months ago #157198
by solia
Product Name, Cust. Name to Subject Admin Email was created by solia
Dear friends:
I have read many other posts about customization of emails, but for some reason I have not been successful in adding the customer name and product name to the administrative email notification SUBJECT line. I have attempted to edit the order.php file like as follows:
$order->mail->subject = '';
if(empty($order->mail->subject)) {
$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->order_product_name,HIKASHOP_LIVE);
(this to add the product name), but I am clearly missing something. Thanks in advance for your patient advice.
Nadine
I have read many other posts about customization of emails, but for some reason I have not been successful in adding the customer name and product name to the administrative email notification SUBJECT line. I have attempted to edit the order.php file like as follows:
$order->mail->subject = '';
if(empty($order->mail->subject)) {
$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->order_product_name,HIKASHOP_LIVE);
(this to add the product name), but I am clearly missing something. Thanks in advance for your patient advice.
Nadine
Please Log in or Create an account to join the conversation.
12 years 4 months ago #157337
by Xavier
Replied by Xavier on topic Product Name, Cust. Name to Subject Admin Email
Hi,
You need this code:
And edit the translation via the menu Configuration > Languages:
You need this code:
Code:
$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->customer->name);
NEW_ORDER_SUBJECT="New order No. %s created on %s, cust name: %s"
Please Log in or Create an account to join the conversation.
12 years 4 months ago #158510
by solia
Replied by solia on topic Product Name, Cust. Name to Subject Admin Email
Xavier, thank you very much for the prompt reply. I spent the time since your reply repeatedly trying to do this and I am failing.
I did precisely what you said to do. I actually made the following change not only in the order.php, but in the overrides too, to make sure I was calling the right code:
if(empty($order->mail->subject)) {
$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->customer->name);
I found that I had to DELETE the usual subject line in the email template, but I cut and pasted your language modifications precisely as you indicate. And then on the tests, I get:
New order No. D7C1 created on http://[site url]/, cust name:
The constant is there, but the variable data for the name is just not being called properly.
Is there anything else I can try? THANKS.
I did precisely what you said to do. I actually made the following change not only in the order.php, but in the overrides too, to make sure I was calling the right code:
if(empty($order->mail->subject)) {
$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->customer->name);
I found that I had to DELETE the usual subject line in the email template, but I cut and pasted your language modifications precisely as you indicate. And then on the tests, I get:
New order No. D7C1 created on http://[site url]/, cust name:
The constant is there, but the variable data for the name is just not being called properly.
Is there anything else I can try? THANKS.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #159666
by Eliot
Replied by Eliot on topic Product Name, Cust. Name to Subject Admin Email
Hi there,
Could you try to do something like var_dump($order); to see if the information you are looking for is loaded here.
Maybe the path is just not the good one.
Could you tell us exactly where you are adding this?
Could you try to do something like var_dump($order); to see if the information you are looking for is loaded here.
Maybe the path is just not the good one.
Could you tell us exactly where you are adding this?
Please Log in or Create an account to join the conversation.
Time to create page: 0.177 seconds