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

#   How to add customer's email address to invoice

##

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

Less More

- Posts: 157
- Thank you received: 8
-
-

14 years 5 months ago [\#51940](#51940) by [vanboke](/forum/user/4873-vanboke "View vanboke's Profile")  *[How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#51940 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")* was created by *[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")*

I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit, but I am uncertain what code I need to use to pull the email address for the customer.

Anyone know what the code needs to be to accomplish this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzUxOTQwLWhvdy10by1hZGQtY3VzdG9tZXItcy1lbWFpbC1hZGRyZXNzLXRvLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

14 years 5 months ago [\#52010](#52010) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#52010 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

It should be:

&lt;?php echo $this-&gt;order-&gt;customer-&gt;user_email; ?&gt;

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

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

Less More

- Posts: 157
- Thank you received: 8
-
-

14 years 5 months ago [\#52038](#52038) by [vanboke](/forum/user/4873-vanboke "View vanboke's Profile")  Replied by *[vanboke](/forum/user/4873-vanboke "View vanboke's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#52038 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Thank you. That worked perfectly.

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

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

Less More

- Posts: 23
- Thank you received: 0
-
-

13 years 10 months ago -  13 years 10 months ago [\#83689](#83689) by [Carey](/forum/user/11933-carey "View Carey's Profile")  Replied by *[Carey](/forum/user/11933-carey "View Carey's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#83689 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

I am trying to add the order # and customers email to the invoice on the backend as well. I know where to find the invoice view in Display&gt;Views, and have tried the code here but don't see any difference. I am not sure if I'm just not adding it in the correct spot. Also can you help me with the code to add the order #.

Last edit: 13 years 10 months ago by [Carey](/forum/user/11933-carey "View Carey's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzUxOTQwLWhvdy10by1hZGQtY3VzdG9tZXItcy1lbWFpbC1hZGRyZXNzLXRvLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

13 years 10 months ago [\#83966](#83966) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#83966 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Yes, that's the correct place for the invoice that you can display on the backend. But since it's on the backend, make sure that you're editing it for the template you're using on your backend and not another template. Otherwise, you won't see any change to the invoice.

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

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

Less More

- Posts: 377
- Thank you received: 7
-
-

12 years 3 months ago [\#166044](#166044) by [Dibben](/forum/user/6788-dibben "View Dibben's Profile")  Replied by *[Dibben](/forum/user/6788-dibben "View Dibben's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#166044 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Hi

Does this still work?

I tried adding &lt;?php echo $this-&gt;order-&gt;customer-&gt;user_email; ?&gt; to the invoice.php pdf file and it doesnt return anything, I was hoping to have Dear 'Name' (email), thank you for your purchase...

Kind regards

Alex

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

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

12 years 3 months ago [\#166185](#166185) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#166185 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Hi Alex,

As Nicolas said previously, are you sure you are editing the file for the right template?
You can simply add a var_dump($this); in the code if you want to see all the variable available.

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

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

Less More

- Posts: 377
- Thank you received: 7
-
-

12 years 3 months ago [\#166407](#166407) by [Dibben](/forum/user/6788-dibben "View Dibben's Profile")  Replied by *[Dibben](/forum/user/6788-dibben "View Dibben's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#166407 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

I think this is because i was editing the invoice pdf not the invoice. Kind regards Alex

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzUxOTQwLWhvdy10by1hZGQtY3VzdG9tZXItcy1lbWFpbC1hZGRyZXNzLXRvLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

12 years 3 months ago [\#166422](#166422) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#166422 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

For the PDF invoice, it's a different code that you need to use:
&lt;?php echo $order-&gt;customer-&gt;user_email; ?&gt;

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

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

Less More

- Posts: 8
- Thank you received: 2
-
-

9 years 4 months ago -  9 years 4 months ago [\#272898](#272898) by [andrewHS](/forum/user/45344-andrewhs "View andrewHS's Profile")  Replied by *[andrewHS](/forum/user/45344-andrewhs "View andrewHS's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#272898 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

I am sorry to ask, but i have no php knowledge. Can you point exactly how/where this code is inserted?

I believe this is the display &gt; view section of the billing/shipping address where I would like the email address to come after:

current output: Mr. Customer
123 Main St.
92081 Vista, CA
United States of America
Telephone: 619.345.3422
Add email Here xxxxxxxxxx Code:

&lt;table width="100%"&gt; &lt;tr&gt; &lt;?php if($this-&gt;invoice_type=='full' &amp;&amp; !empty($this-&gt;element-&gt;billing_address)){?&gt; &lt;td&gt; &lt;fieldset class="adminform" id="htmlfieldset_billing"&gt; &lt;legend style="background-color: #FFFFFF;"&gt;&lt;?php echo JText::_('HIKASHOP_BILLING_ADDRESS'); ?&gt;&lt;/legend&gt; &lt;?php $class = hikashop_get('class.address'); echo $class-&gt;displayAddress($this-&gt;element-&gt;fields,$this-&gt;element-&gt;billing_address,'order'); ?&gt; &lt;/fieldset&gt; &lt;/td&gt; &lt;?php }?&gt; &lt;td&gt; &lt;?php if(!empty($this-&gt;element-&gt;order_shipping_id) &amp;&amp; !empty($this-&gt;element-&gt;shipping_address)){ ?&gt; &lt;fieldset class="adminform" id="htmlfieldset_shipping"&gt; &lt;legend style="background-color: #FFFFFF;"&gt;&lt;?php echo JText::_('HIKASHOP_SHIPPING_ADDRESS'); ?&gt;&lt;/legend&gt; &lt;?php if(empty($this-&gt;element-&gt;override_shipping_address)) { $class = hikashop_get('class.address'); echo $class-&gt;displayAddress($this-&gt;element-&gt;fields,$this-&gt;element-&gt;shipping_address,'order'); } else { echo $this-&gt;element-&gt;override_shipping_address; } ?&gt; &lt;/fieldset&gt; &lt;?php } ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;

Last edit: 9 years 4 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] tag is nice !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzUxOTQwLWhvdy10by1hZGQtY3VzdG9tZXItcy1lbWFpbC1hZGRyZXNzLXRvLWludm9pY2U/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

9 years 4 months ago [\#272948](#272948) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#272948 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Hi,

You can add your code just before the tag &lt;/fieldset&gt; in that piece of code.
Note however that it's not :
&lt;?php echo $this-&gt;order-&gt;customer-&gt;user_email; ?&gt;
but:
&lt;?php echo $this-&gt;element-&gt;customer-&gt;user_email; ?&gt;
that you should now use.
Also note that even if you make a mistake in a view file, you can click on the bin icon on the listing for that view file to revert to the default code. So you can do modifications by trial and error in the view files for small modifications like that.

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

- **[Joomill](/forum/user/33738-joomill "View Joomill's Profile")**
- [![Joomill's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33738.jpg)](/forum/user/33738-joomill "View Joomill's Profile")
- [ Offline](/forum/user/33738-joomill)

Less More

- Posts: 224
- Thank you received: 10
-
-
- [](http://www.joomill.nl)
-

8 years 11 months ago [\#284798](#284798) by [Joomill](/forum/user/33738-joomill "View Joomill's Profile")  Replied by *[Joomill](/forum/user/33738-joomill "View Joomill's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#284798 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Hi Nicolas,

After updating Hikashop to 3.2.2 and the new attach invoice plugin this line stops working.
i tried to add $this-&gt;order or $this-&gt;element befor &lt;/fieldset&gt; but both result in empty.

Can you have a look at it? Thanks!

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

- **[Joomill](/forum/user/33738-joomill "View Joomill's Profile")**
- [![Joomill's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33738.jpg)](/forum/user/33738-joomill "View Joomill's Profile")
- [ Offline](/forum/user/33738-joomill)

Less More

- Posts: 224
- Thank you received: 10
-
-
- [](http://www.joomill.nl)
-

8 years 11 months ago [\#284802](#284802) by [Joomill](/forum/user/33738-joomill "View Joomill's Profile")  Replied by *[Joomill](/forum/user/33738-joomill "View Joomill's Profile")* on topic *[Re: How to add customer's email address to invoice](/forum/4-how-to/51940-how-to-add-customers-email-address-to-invoice#284802 "I need to add the customer's email address to the invoice that is generated from the Invoice button while looking at the order. I have found the invoice view in Display-&gt;Views that I need to edit,...")*

Found it allready.
This will work for me:

&lt;?php echo $order-&gt;customer-&gt;user_email; ?&gt;

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

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