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

#   Getting user name on invoice

##

- **[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")**
- [![cpaschen's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2013-01-25.jpg)](/forum/user/12420-cpaschen "View cpaschen's Profile") Topic Author
- [ Offline](/forum/user/12420-cpaschen)

Less More

- Posts: 196
- Thank you received: 6
-
-
-
- [](http://www.paschencommunications.com)
-

8 years 3 weeks ago [\#299086](#299086) by [cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")  *[Getting user name on invoice](/forum/35-orders-management/895957-getting-user-name-on-invoice#299086 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.12 -- PHP version -- : 7.1.15  When I display the Invoice (from admin) the 'Ordered by' area is blank, as is the billing address.  We don't collect that information from users when ordering because they have already supplied that information via Community Builder when they set-up their user account.  Is there any way to ...  1. Pull in the user's data into a HS address record (for billing or shipping) automatically from CB? OR 2. Can we at least get the order to show the customer's name and email address on the invoice (that is already displaying in the &quot;Customer&quot; area in the order details)  Additionally, when I try to edit the Billing address/Shipping address on the admin side of the order, clicking the check mark (to accept the change) just clears everything entered.  NOTE: I have tried to look through the display area to determine where to make changes to the template; however, I don't know which of the many templates to change and (esp. for option 2 above) how to access the name/email data.")* was created by *[cpaschen](/forum/user/12420-cpaschen "View cpaschen's Profile")*

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.12
-- PHP version -- : 7.1.15

When I display the Invoice (from admin) the 'Ordered by' area is blank, as is the billing address.

We don't collect that information from users when ordering because they have already supplied that information via Community Builder when they set-up their user account.

Is there any way to ...

1. Pull in the user's data into a HS address record (for billing or shipping) automatically from CB?
OR
2. Can we at least get the order to show the customer's name and email address on the invoice (that is already displaying in the "Customer" area in the order details)

Additionally, when I try to edit the Billing address/Shipping address on the admin side of the order, clicking the check mark (to accept the change) just clears everything entered.

NOTE: I have tried to look through the display area to determine where to make changes to the template; however, I don't know which of the many templates to change and (esp. for option 2 above) how to access the name/email data.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5NTk1Ny1nZXR0aW5nLXVzZXItbmFtZS1vbi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) 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: 86358
- Thank you received: 14293
-
-

8 years 3 weeks ago [\#299090](#299090) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Getting user name on invoice](/forum/35-orders-management/895957-getting-user-name-on-invoice#299090 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.12 -- PHP version -- : 7.1.15  When I display the Invoice (from admin) the 'Ordered by' area is blank, as is the billing address.  We don't collect that information from users when ordering because they have already supplied that information via Community Builder when they set-up their user account.  Is there any way to ...  1. Pull in the user's data into a HS address record (for billing or shipping) automatically from CB? OR 2. Can we at least get the order to show the customer's name and email address on the invoice (that is already displaying in the &quot;Customer&quot; area in the order details)  Additionally, when I try to edit the Billing address/Shipping address on the admin side of the order, clicking the check mark (to accept the change) just clears everything entered.  NOTE: I have tried to look through the display area to determine where to make changes to the template; however, I don't know which of the many templates to change and (esp. for option 2 above) how to access the name/email data.")*

Hi,

To know which view file you want to edit, you can use the "Display view files" setting of the Hikashop ocnfiguration:
[ www.hikashop.com/support/documentation/1...-display.html#layout](https://www.hikashop.com/support/documentation/153-customize-the-display.html#layout)

You sure can pull the address from CB in a HS address.
For example, you could do that in the onBeforeOrderCreate(&amp;$order, &amp;$do) trigger in a custom plugin of the group hikashop.
In there, you could use such code to get the joomla id: Code:

$user = hikashop_loadUser(true); $id = $user-&gt;user_cms_id;

Then, you could call CB to load the address based on that ID, or with a MySQL query (you have to check with the support of CB about how to do that).
Once you have the address, you can create a new record in the table hikashop_address using $user-&gt;user_id as the user_id in the hikashop_address table and the data from CB for the other fields. You can use a MySQL query or the code of HikaShop like that: Code:

$addressClass = hikashop_get('class.address'); $address_id = $addressClass-&gt;save($address);

And then you can use that address_id in the order like that: Code:

$order-&gt;order_billing_address_id = $address_id;

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

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