Skip to main content

[SOLVED] Add ORDER NUMBER to the Subject Line

More
13 years 11 months ago - 13 years 11 months ago #71814 by MSTACE
We use Google Business email for our domain emails.
While it is good, the whole concept of conversation and email THREADS is based on the SUBJECT LINE of the email.

HikaShop sends the email "A new order has been created on your website" but there isn't any ORDER NUMBER in that subject line.
SO -- Gmail threads ALL of our orders together in one huge thread.
It makes it very difficult to look at the latest order received, have a conversation with the purchaser, etc.

Would it be possible to add the ORDER NUMBER to the Subject Line of that first 'A new order...' email?
The order number appears in the Payment Received emails subject line...

Thanks!
Last edit: 13 years 11 months ago by MSTACE.

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

More
13 years 11 months ago #71838 by Eliot
Hi,

As it's explained in this topic , you have to replace the following lines in administrator/component/com_hikashop/class/order.php
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 these lines:
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 #71990 by MSTACE
There is a quotation mark missing from that code example.
I used the other code explained in that topic and it works terrific!

Might suggest that this become an option in the configuration as it is quite helpful.

Thank you.

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

More
13 years 7 months ago #91898 by mad-q
Which file would I put this in so that the customer also has the order number in their subject? Also is there a way to have the orders come to us with the customers e-mail address as the FROM instead of having our own e-mail address as the FROM information.

Thanks
Iain

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

More
13 years 7 months ago #91931 by Xavier
For the customers, you have to edit the mails "Order creation notification" and "Order status notification".
To change the sender email you can use the code:
<?php $mails->sender = $data->cart->customer->email; ?>
At the end of the mail.

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

More
13 years 7 months ago #91932 by Xavier
For the customers, you have to edit the mails "Order creation notification" and "Order status notification".
To change the sender email you can use the code:
<?php $mail->sender = $data->cart->customer->email; ?>
At the end of the mail.

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

More
13 years 7 months ago #91981 by mad-q
Hello,

I have put that at the end of the email and it doesn't change. When you say at the end, do you mean the very last line?

Iain

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

More
13 years 7 months ago #92022 by Xavier
Can you try with "$this->mailer->Sender" instead of "$mail->sender" ?

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

More
13 years 7 months ago #92034 by mad-q
That is the same, no change. I am putting this at the bottom of System>email>Order administrator notification.

Yours
Iain

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

More
13 years 7 months ago #92389 by nicolas
There is no need to do that change.

The From is indeed not the user email but the Reply-To is. Which means that if you click on reply on the order admin email, you will send the reply to the user email address automatically.

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

More
13 years 7 months ago #92413 by mad-q
Nicolas

Thank you but I find it annoying when looking down a list of e-mails not to see the customers name but only Draganfly Motorcycles.

Iain

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

More
13 years 7 months ago #92430 by nicolas
In that case add such code at the end of the order admin email:
Code:
<?php $userClass = hikashop_get('class.user'); $userClass->get(false); $user = $userClass->get($data->order_user_id); $mail->from_email = $user->user_email; $mail->from_name = $user->name;

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

More
12 years 1 month ago - 12 years 1 month ago #166743 by cpaschen
Needing to revive this old thread ....

I'm using HS Business 2.3.2.

I've made the change to the /administrator/components/com_hikashop/classes/order.php file as indicated here in this thread.

Here is the code that I inserted:
Code:
$order->mail->subject = ''; if(empty($order->mail->subject)) { $order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,'HIKASHOP_LIVE'); }

However, when the emails are sent, the subject line is being sent like this:

New order No. 03390 created on HIKASHOP_LIVE


I have added 'HIKASHOP_LIVE' to the lanugage overrides area of Joomla, but it isn't being 'translated' (although 'NEW_ORDER_SUBJECT' IS).

Any ideas why this isn't working?
Last edit: 12 years 1 month ago by cpaschen. Reason: fixing code indenting

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

More
12 years 1 month ago #166744 by cpaschen
OK... I've narrowed it down.

The current language string for NEW_ORDER_SUBJECT is "New order N0. %s created on %s"

I've removed the quotes around 'HIKASHOP_LIVE'.

(I saw a mention of quote missing earlier in this thread and though that 'hikashop_live' was a language string to be handled by JText) Hopefully this will help.

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

More
12 years 1 month ago #166762 by cpaschen
OK ... it was the quotes on that 2nd entry.

So the working version of the code should be:
Code:
$order->mail->subject = ''; if(empty($order->mail->subject)) { $order->mail->subject = JText::sprintf('NEW_ORDER_SUBJECT',$order->order_number,HIKASHOP_LIVE); }


However, that HIKASHOP_LIVE variable inserts the URL to the site.

Anybody know if there is a way (a different variable) to insert the 'Name' of the site (instead of the URL)?

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

More
12 years 1 month ago #166777 by Jerome
Hi,

HIKASHOP_LIVE is the url to the live site ; if you want to display something else you should put something else in the code.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

More
12 years 1 month ago #166808 by cpaschen
Jerome,

Thanks, but that doesn't answer my question - WHAT variable can I use for the 'name' of the site?

Or better yet, is there a doc somewhere that lists any variables that are specific to Hikashop that could be used here (or other places of HS/Joomla)?

I'm guessing that I could just use standard Joomla variables/resources here, but I could have done that instead of 'HIKASHOP_LIVE'.

So what other variables like this (specific to HS) are also available?

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

More
12 years 1 month ago #166821 by nicolas
Hi,

HikaShop does not have any variable for the website name, only for the website URL.
If you want to get the website name, that's a setting of the Joomla configuration, so you can access it with Joomla code:
$conf = JFactory::getConfig();
echo $conf->get('sitename');

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

More
11 years 9 months ago #183195 by Lynn
Id really like to request an easier way to do this as a feature, such as field in CONFIG that lets you enter macros and text.

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

More
11 years 9 months ago #183211 by MSTACE

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

Time to create page: 0.351 seconds
Powered by Kunena Forum