Product Name, Cust. Name to Subject Admin Email

  • Posts: 30
  • Thank you received: 2
10 years 6 months ago #157198

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

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #157337

Hi,

You need this code:

$order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE,$order->customer->name);
And edit the translation via the menu Configuration > Languages:

NEW_ORDER_SUBJECT="New order No. %s created on %s, cust name: %s"

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

  • Posts: 30
  • Thank you received: 2
10 years 5 months ago #158510

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.

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

  • Posts: 2334
  • Thank you received: 403
10 years 5 months ago #159666

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?

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

Time to create page: 0.084 seconds
Powered by Kunena Forum