Changing the customers name in emails

  • Posts: 16
  • Thank you received: 0
12 years 3 months ago #60752

Hi,
I have a site where there is no registration at checkout.

This has resulted in the emails for 'order creation notification' and 'order status notification' having 'Hi ,' at the start of the email.

To have the email start with 'Hi [billing address->first name],' what do I need to change in the code:
echo JText::sprintf('HI_CUSTOMER',@$data->customer->name);?>
and
echo JText::sprintf('HI_CUSTOMER',@$customer->name);?>

Thanks,
Geoff

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
12 years 3 months ago #60754

Hi,

In the creation notification and status notification emails you can use:

echo @$data->cart->billing_address->address_firstname;

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 16
  • Thank you received: 0
12 years 3 months ago #60797

Thanks Jerome

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

  • Posts: 61
  • Thank you received: 1
12 years 1 month ago #69683

Hi refreshing this thread:

I put the following line in the "Order creation notification" template
<?php echo JText::sprintf('HI_CUSTOMER',@$data->cart->billing_address->address__title." ".@$data->customer->name);?>

In the e-mail to the customer the output is ""Hello Mr. XXXYYY".
But my Page is in German and the Shop (Select in Registration and Output auf Title in the shipping Adress) is korrect in German (Herr, Frau).
What I have to do, to get in the email the German Traslation of what User see on Webpage in the Select (drop down) for the Titel (Mr, Ms)?

Thank you

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
12 years 1 month ago #69888

Hi,

Instead of @$data->cart->billing_address->address_title, you should have:
JText::_(preg_replace('#[^a-z0-9]#i','_',strtoupper(@$data->cart->billing_address->address_title))

That will convert the data in the database, which is always in english, to the current language.

Last edit: 8 years 8 months ago by nicolas.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum