Put Order ref details in email subject

  • Posts: 17
  • Thank you received: 0
8 years 3 months ago #247350

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6

Hi

How can we get some order details put in the subject line of notification emails?

This is for the shop owner not the customer - they would like the customer name inserted in the subject I think.

Thanks :)

Last edit: 8 years 3 months ago by bobhawthorne.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 3 months ago #247353

Hi,

There is no easy override system for that.
You'll have to edit the code of the file administrator/components/com_hikashop/classes/order.php to do it but the code will depends based on which email you want to modify exactly.
Actually, we're working on a modification for the next version of HikaShop so that you'll be able to add tags in the translation of the subject of emails like that {customer.name} to easily do that. So if it's not urgent, I would recommend to wait until then to do that.

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #252199

Hi Nicholas,
When do you expect this new version to be available with the feature of being able to add the customer's name to the notification emails?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252203

Hi,

The next version of my previous message has been released a few weeks ago and thus, if you have HikaShop 2.6.4, you already have that modification.

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

  • Posts: 17
  • Thank you received: 0
8 years 1 month ago #252256

Instructions / documentation please?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252265

Hi,

Well, it's what I said two messages above:

you'll be able to add tags in the translation of the subject of emails like that {customer.name}

So edit the email, and in the subject of the email, you can modify your text to have such tags.

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #252308

Hi,
Tried modifying the subject line of the Order Administrator Notification email with the line "Web Order - {customer.name}" and it came back with only "Web Order - " as the subject in the email. Is there something else that needs to be done to get this to work? I have already upgraded to 2.6.4

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252386

Hi,

Thanks for the feedback. Then, can you try changing the code:

if(!empty($table) && !empty($mail->data->$table)){
					if(!empty($mail->data->$table->$var)){
						$val = $mail->data->$table->$var;
					}
				}elseif(!empty($mail->data->$var)){
					$val = $mail->data->$var;
				}
to:
if(!empty($table) && !empty($var)){
					if(!empty($mail->data->$table->$var)){
						$val = $mail->data->$table->$var;
					}elseif(!empty($mail->data->cart->$table->$var)){
						$val = $mail->data->cart->$table->$var;
					}
				}elseif(!empty($mail->data->$table)){
					$val = $mail->data->$table;
				}
in the file administrator/components/com_hikashop/classes/mail.php and try again ?

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #252390

HI,
Modified that code but am getting the same results. No customer name included on the subject line.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252465

Hi,

Thanks. I've done additional tests and I think it comes from this line in my code:
list($table, $var) = explode($var, '.', 2);
Replace it by:
list($table, $var) = explode('.', $var, 2);
That fixes the problem on my end.

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #252494

I think we are getting closer.

Now I get the word "Array" instead of the customer's name

Any more thoughts as to why it isn't working for me?

Last edit: 8 years 1 month ago by a2zcs.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252540

Hi,

I'm out of ideas. I've done the tests and fix myself on my end and it's now working for me.
Could you provide a backend access and FTP access and some instructions to easily reproduce the problem on your website so that we could have a look at it ?
You can send that with a link to this thread via our contact form:
www.hikashop.com/support/contact-us.html

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252645

Hi,

We got your backend access but your mesage didn't contain information for a FTP access. Could you also provide a FTP access so that we can move forward please ?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252791

Hi,

We got your FTP access but it doesn't allow us to access your website files:
take.ms/xZfvh
Could you do something about that please ?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #252953

Hi,

I've adapted the code to:

if(!empty($table) && !empty($var)){
					if(!empty($mail->data->cart->$table->$var)){
						$val = $mail->data->cart->$table->$var;
					}elseif(!empty($mail->data->$table->$var)){
						$val = $mail->data->$table->$var;
					}
				}elseif(!empty($mail->data->$table)){
					$val = $mail->data->$table;
				}
and it seems to be working on your end too.

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #252960

Hi,
It still is not working. The subject line on the notification email still says "Array" instead of the customer's name.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #253071

Hi,

I'm not able to reproduce the problem on your website.
I've changed temporarily your "order admin notification email address" to our contact email address and you can see that the subject of the email we receive correctly contains the name of the user account of our test user account:
take.ms/cTVn3
And that's the same with the tests we did on our local test server.

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

  • Posts: 268
  • Thank you received: 7
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
8 years 1 month ago #253072

Ok,
Just figure a little bit more out.
It is working if the customer is registered. It is not if the customer checks out as guest. Also appears to be only using the First Name, Full name if possible, would be much more useful.

Also upon clicking "Finish" there is coding that comes up in the pop up window. Please see attached.



Thank you for all your attention to this.

Attachments:
Last edit: 8 years 1 month ago by a2zcs.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #253074

Hi,

It's normal that it doesn't work if the user is a guest since there user no user account for him and the name field of the user account that it used by that tag is not available.
Then, instead of that tag, you probably want to use the tags {billing_address.address_firstname} {billing_address.address_lastname}
so that the information comes from the billing address which is always there.

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

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
7 years 1 week ago #282370

Nicolas,
where to put that tags {billing_address.address_firstname} {billing_address.address_lastname}?
In translations file or in email config email subject field?

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

Time to create page: 0.119 seconds
Powered by Kunena Forum