Skip to main content

Ordner Number in Mail subject

More
13 years 11 months ago #69210 by Rolandus1
Hi
I want add the order number into the mail subject for all mails sending to the admin of the site/shop.
How I have to do this?

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

More
13 years 11 months ago #69266 by Xavier
Hi Rolandus1,

I think that you will have to edit the file: "yourSite\administrator\components\com_hikashop\classes\order.php".
In the function "save()", add the line:
Code:
$mail->subject = "ORDER_STATUS_NOTIFICATION ".$order->order_number;

After:
Code:
$send_email = @$order->history->history_notified; $dispatcher->trigger( 'onAfterOrderUpdate', array( & $order,&$send_email) ); if($send_email) { if(empty($order->mail) && isset($order->order_status)) { $this->loadOrderNotification($order,'order_status_notification'); } else { $order->mail->data = &$order; $order->mail->mail_name = 'order_status_notification'; } if(!empty($order->mail)) { $mail = hikashop_get('class.mail'); if(!empty($order->mail->dst_email)) {

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

More
13 years 11 months ago #69426 by Rolandus1
Hi I did what you described, but I got only "ORDER_STATUS_NOTIFICATION" as text in the mail subject.

In the original file I have the posted code below. Do I have to replace the line "$mail->sendMail($order->mail);" with the line you posted?


}else{
$send_email = @$order->history->history_notified;
$dispatcher->trigger( 'onAfterOrderUpdate', array( & $order,&$send_email) );
if($send_email){
if(empty($order->mail) && isset($order->order_status)){
$this->loadOrderNotification($order,'order_status_notification');
}
if(!empty($order->mail)){
$mail = hikashop_get('class.mail');
if(!empty($order->mail->dst_email)){
$mail->sendMail($order->mail);
}
$this->mail_success =& $mail->mail_success;
}
}
}
}
return $order->order_id;
}
return false;
}

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

More
13 years 11 months ago #69477 by Xavier
Hi,

No you have not to replace, but add before "$mail->sendMail($order->mail);".
The sendMail() function send the mail, so if you remove it...

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

More
13 years 11 months ago #69534 by Rolandus1
OK, now the code part looks like this, but I don't receive any order number in the "new order" mail to the administrator.



}else{
$send_email = @$order->history->history_notified;
$dispatcher->trigger( 'onAfterOrderUpdate', array( & $order,&$send_email) );
if($send_email){
if(empty($order->mail) && isset($order->order_status)){
$this->loadOrderNotification($order,'order_status_notification');
}
if(!empty($order->mail)){
$mail = hikashop_get('class.mail');
if(!empty($order->mail->dst_email)){
$mail->subject = "ORDER_STATUS_NOTIFICATION".$order->order_number;
$mail->sendMail($order->mail);
}
$this->mail_success =& $mail->mail_success;
}
}
}
}
return $order->order_id;
}
return false;

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

More
13 years 11 months ago #69600 by Xavier
My apologize the wrong code has been edited, you edited to have the order number for a status update.
To have the order number in the order creation mail, in the same file replace:
Code:
$order->mail->subject = trim($order->mail->subject); if(empty($order->mail->subject)) { $order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE); }

By:
Code:
$order->mail->subject = ''; if(empty($order->mail->subject)) { $order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE); }

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

More
13 years 11 months ago #69628 by Rolandus1
It works !
But I wanted first the order number in the subject, then the subject text, because I want order the e-mail list by order number.
What I get now as admin is a subject only with the order number without the following text.
What's wrong ?


$order->mail->subject = '';
if(empty($order->mail->subject)) {
$order->mail->subject = JText::sprintf($order->order_number,'NEW_ORDER_SUBJECT',HIKASHOP_LIVE);
}

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

More
13 years 11 months ago #69635 by Xavier
You can make your own text for this email, you just have to replace the content of the "$order->mail->subject" variable.
For example:
Code:
$order->mail->subject = $order->order_number." - New Order on your website: ".HIKASHOP_LIVE;
(HIKASHOP_LIVE is the url of your website)
The following user(s) said Thank You: Rolandus1

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

More
13 years 11 months ago #69676 by Rolandus1
Perfekt. Thank you !

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

Time to create page: 0.238 seconds
Powered by Kunena Forum