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

#   How do I add the field "Username" to Invoice?

##

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

Less More

- Posts: 22
- Thank you received: 2
-
-

12 years 2 months ago [\#166550](#166550) by [qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")  *[How do I add the field "Username" to Invoice?](/forum/36-reports-statistics/870203-how-do-i-add-the-field-username-to-invoice#166550 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.4 -- Browser(s) name and version -- : chrome  I would like to add the field &quot;username&quot; to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:  username;?&gt;  Can anyone help with some advice on the syntax for the username field please.  Thanks, Keith")* was created by *[qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")*

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 2.5.24
-- PHP version -- : 5.4
-- Browser(s) name and version -- : chrome

I would like to add the field "username" to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:

&lt;?php echo JText::_('QJA Member').': '.@$this-&gt;username;?&gt;

Can anyone help with some advice on the syntax for the username field please.

Thanks,
Keith

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

12 years 2 months ago [\#166565](#166565) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How do I add the field "Username" to Invoice?](/forum/36-reports-statistics/870203-how-do-i-add-the-field-username-to-invoice#166565 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.4 -- Browser(s) name and version -- : chrome  I would like to add the field &quot;username&quot; to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:  username;?&gt;  Can anyone help with some advice on the syntax for the username field please.  Thanks, Keith")*

Hi,

Try like that:
&lt;?php echo JText::_('QJA Member').': '.@$this-&gt;element-&gt;username;?&gt;

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

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

Less More

- Posts: 22
- Thank you received: 2
-
-

12 years 2 months ago -  12 years 2 months ago [\#166675](#166675) by [qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")  Replied by *[qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")* on topic *[How do I add the field "Username" to Invoice?](/forum/36-reports-statistics/870203-how-do-i-add-the-field-username-to-invoice#166675 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.4 -- Browser(s) name and version -- : chrome  I would like to add the field &quot;username&quot; to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:  username;?&gt;  Can anyone help with some advice on the syntax for the username field please.  Thanks, Keith")*

Thank you for you reply. I updated my syntax to match your suggestion - unfortunately it displays the text "QJA Member" fine but the field content is still blank.

The syntax reads: Code:

&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 echo JText::_('QJA Member').': '.@$this-&gt;element-&gt;username;?&gt;&lt;br/&gt; &lt;?php $this-&gt;setLayout('address_template'); $html = $this-&gt;loadTemplate(); foreach($this-&gt;element-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; $html=str_replace('{'.$fieldname.'}',$this-&gt;fieldsClass-&gt;show($field,$this-&gt;element-&gt;billing_address-&gt;$fieldname),$html); } echo str_replace("\n","&lt;br/&gt;\n",trim(str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)),"\n")); ?&gt; &lt;/fieldset&gt;

Third line down is the line I have added.

Any ideas?

Regards,
Keith

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

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 months ago [\#166698](#166698) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How do I add the field "Username" to Invoice?](/forum/36-reports-statistics/870203-how-do-i-add-the-field-username-to-invoice#166698 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.4 -- Browser(s) name and version -- : chrome  I would like to add the field &quot;username&quot; to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:  username;?&gt;  Can anyone help with some advice on the syntax for the username field please.  Thanks, Keith")*

Hi,

I will make the supposition that you are edting the view "backend &#124; order &#124; invoice" (it is always better the provide the full localisation of the view, because if there are several views with the same name ; they don't have the same path !)

The full order is loaded under $this-&gt;element
The user is loaded by the full order, it will be under $this-&gt;element**-&gt;customer**
So, the username : $this-&gt;element**-&gt;customer**-&gt;username

Regards,

---

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

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

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

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

Less More

- Posts: 22
- Thank you received: 2
-
-

12 years 2 months ago [\#166838](#166838) by [qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")  Replied by *[qjawebadmin](/forum/user/9129-qjawebadmin "View qjawebadmin's Profile")* on topic *[How do I add the field "Username" to Invoice?](/forum/36-reports-statistics/870203-how-do-i-add-the-field-username-to-invoice#166838 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.4 -- Browser(s) name and version -- : chrome  I would like to add the field &quot;username&quot; to the invoice. I have found the Display-&gt;Views-&gt;Invoice and can edit the code. I would like to add the following but obviously I have the syntax wrong as it is not displaying the username:  username;?&gt;  Can anyone help with some advice on the syntax for the username field please.  Thanks, Keith")*

Perfect - worked a charm. Thank you very much.
Keith

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

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

[](#top)
