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

#   Customer name to appear on email

##

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

Less More

- Posts: 209
- Thank you received: 18
-
-

15 years 4 months ago -  15 years 4 months ago [\#19958](#19958) by [JIK](/forum/user/362-jik "View JIK's Profile")  *[Customer name to appear on email](/forum/4-how-to/19958-customer-name-to-appear-on-email#19958 "Hi,  I'm using the &quot;No registration&quot; method and I need to know how to get the customer's name to appear in the Order Creation Email (Business Ed.) The customer is supplying a first and last name during checkout.  Looking at the code for the email I have changed the field from name to firstname but still no joy.  How do I call the customer's firstname so that the email reads &quot;Hi John,&quot; instead of just &quot;Hi ,&quot;  Cheers!")* was created by *[JIK](/forum/user/362-jik "View JIK's Profile")*

Hi,

I'm using the "No registration" method and I need to know how to get the customer's name to appear in the Order Creation Email (Business Ed.) The customer is supplying a first and last name during checkout.

Looking at the code for the email I have changed the field from *name* to *firstname* but still no joy. Code:

echo JText::sprintf('HI_CUSTOMER',@$data-&gt;customer-&gt;firstname);

How do I call the customer's firstname so that the email reads "Hi John," instead of just "Hi ,"

Cheers!

Last edit: 15 years 4 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

15 years 4 months ago [\#19979](#19979) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Customer name to appear on email](/forum/4-how-to/19958-customer-name-to-appear-on-email#19979 "Hi,  I'm using the &quot;No registration&quot; method and I need to know how to get the customer's name to appear in the Order Creation Email (Business Ed.) The customer is supplying a first and last name during checkout.  Looking at the code for the email I have changed the field from name to firstname but still no joy.  How do I call the customer's firstname so that the email reads &quot;Hi John,&quot; instead of just &quot;Hi ,&quot;  Cheers!")*

You should try something like that instead: Code:

echo JText::sprintf('HI_CUSTOMER',@{$data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]}-&gt;address_firstname);

Note for others: The emails can be edited via the menu System-&gt;Emails in the business edition.

The following user(s) said Thank You: [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")

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

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

Less More

- Posts: 45
- Thank you received: 2
-
-

14 years 6 months ago -  14 years 6 months ago [\#48757](#48757) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  Replied by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")* on topic *[Re: Customer name to appear on email](/forum/4-how-to/19958-customer-name-to-appear-on-email#48757 "Hi,  I'm using the &quot;No registration&quot; method and I need to know how to get the customer's name to appear in the Order Creation Email (Business Ed.) The customer is supplying a first and last name during checkout.  Looking at the code for the email I have changed the field from name to firstname but still no joy.  How do I call the customer's firstname so that the email reads &quot;Hi John,&quot; instead of just &quot;Hi ,&quot;  Cheers!")*

> nicolas wrote: You should try something like that instead:
>
> Code:
>
> echo JText::sprintf('HI_CUSTOMER',@{$data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]}-&gt;address_firstname);

This code works for me if I leave out the {}.

So I am doing it like this: Code:

&lt;?php $title = @$data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]-&gt;address_title; if($title === "Herr") { echo JText::sprintf('Sehr geehrter Herr %s,', @$data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]-&gt;address_lastname); } else if($title === "Frau") { echo JText::sprintf('Sehr geehrte Frau %s,', @$data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]-&gt;address_lastname); } else { echo JText::sprintf('HI_CUSTOMER',@$data-&gt;customer-&gt;name); } ?&gt;

At the moment I am wondering why it goes through the last "else" in the ORDER_STATUS_NOTIFICATION. It seems that $title is blank. **Why? And how to read out the title then?**
In the ORDER_CREATION_NOTIFICATION it works fine.

Last edit: 14 years 6 months ago by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile").

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 6 months ago [\#48793](#48793) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Customer name to appear on email](/forum/4-how-to/19958-customer-name-to-appear-on-email#48793 "Hi,  I'm using the &quot;No registration&quot; method and I need to know how to get the customer's name to appear in the Order Creation Email (Business Ed.) The customer is supplying a first and last name during checkout.  Looking at the code for the email I have changed the field from name to firstname but still no joy.  How do I call the customer's firstname so that the email reads &quot;Hi John,&quot; instead of just &quot;Hi ,&quot;  Cheers!")*

That code is indeed for the order creation notification.
For the order status notification, you will have to use such code instead:
$data-&gt;cart-&gt;billing_address-&gt;address_title
but only AFTER the loadFullOrder function call in the email.

The following user(s) said Thank You: [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE5OTU4LWN1c3RvbWVyLW5hbWUtdG8tYXBwZWFyLW9uLWVtYWlsP3RtcGw9bWFya2Rvd24=) 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.069 seconds

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

[](#top)
