[Skip to main content](#vessel-content)

#   Ordner Number in Mail subject

##

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile") Topic Author
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69210](#69210) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  *[Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69210 "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?")* was created by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#69266](#69266) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69266 "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?")*

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-&gt;subject = "ORDER_STATUS_NOTIFICATION ".$order-&gt;order_number;

After: Code:

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile") Topic Author
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69426](#69426) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  Replied by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69426 "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?")*

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-&gt;sendMail($order-&gt;mail);" with the line you posted?

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#69477](#69477) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69477 "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?")*

Hi,

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile") Topic Author
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69534](#69534) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  Replied by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69534 "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?")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#69600](#69600) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69600 "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?")*

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-&gt;mail-&gt;subject = trim($order-&gt;mail-&gt;subject); if(empty($order-&gt;mail-&gt;subject)) { $order-&gt;mail-&gt;subject = JText::sprintf('NEW_ORDER_SUBJECT',$order-&gt;order_number,HIKASHOP_LIVE); }

By: Code:

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile") Topic Author
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69628](#69628) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  Replied by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69628 "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?")*

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-&gt;mail-&gt;subject = '';
if(empty($order-&gt;mail-&gt;subject)) {
$order-&gt;mail-&gt;subject = JText::sprintf($order-&gt;order_number,'NEW_ORDER_SUBJECT',HIKASHOP_LIVE);
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 1 month ago [\#69635](#69635) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69635 "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?")*

You can make your own text for this email, you just have to replace the content of the "$order-&gt;mail-&gt;subject" variable.
For example: Code:

$order-&gt;mail-&gt;subject = $order-&gt;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](/forum/user/6166-rolandus1 "View Rolandus1's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")**
- [![Rolandus1's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6166-rolandus1 "View Rolandus1's Profile") Topic Author
- [ Offline](/forum/user/6166-rolandus1)

Less More

- Posts: 61
- Thank you received: 1
-
-

14 years 1 month ago [\#69676](#69676) by [Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")  Replied by *[Rolandus1](/forum/user/6166-rolandus1 "View Rolandus1's Profile")* on topic *[Re: Ordner Number in Mail subject](/forum/2-general-talk-about-hikashop/69210-ordner-number-in-mail-subject#69676 "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?")*

Perfekt. Thank you !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzY5MjEwLW9yZG5lci1udW1iZXItaW4tbWFpbC1zdWJqZWN0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.067 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
