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

#   show user id in front end

##

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

Less More

- Posts: 27
- Thank you received: 0
-
-

14 years 8 months ago [\#40809](#40809) by [justaguy](/forum/user/6149-justaguy "View justaguy's Profile")  *[show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#40809 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")* was created by *[justaguy](/forum/user/6149-justaguy "View justaguy's Profile")*

Hi,
First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you.
now for my question.

I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop_user_id.

I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.

Thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 8 months ago [\#41014](#41014) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#41014 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")*

When HikaShop is loaded, you can do like that:

$user = hikashop_loadUser(true);
echo $user-&gt;hikashop_user_id;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 27
- Thank you received: 0
-
-

14 years 8 months ago [\#41406](#41406) by [justaguy](/forum/user/6149-justaguy "View justaguy's Profile")  Replied by *[justaguy](/forum/user/6149-justaguy "View justaguy's Profile")* on topic *[Re: show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#41406 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")*

What about if hikashop is not loaded?
How do I load it in my module?

Thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 27
- Thank you received: 0
-
-

14 years 8 months ago -  14 years 8 months ago [\#41512](#41512) by [justaguy](/forum/user/6149-justaguy "View justaguy's Profile")  Replied by *[justaguy](/forum/user/6149-justaguy "View justaguy's Profile")* on topic *[Re: show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#41512 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")*

What i meant was, if I wan't to display my module on the homepage, but there is no product/cart/ or any thing from hikashop.
How could I load fast with out needing to do some thing like that: Code:

$user =&amp; JFactory::getUser(); $usercmsid = $user-&gt;id; $username = $user-&gt;name; $jdb =&amp; JFactory::getDBO(); $query = 'SELECT user_id FROM hikashop_user WHERE user_cms_id = '.$usercmsid.''; $jdb-&gt;setQuery($query); $user_id = $jdb-&gt;loadResult();

your code of $user = hikashop_loadUser(true); gives me this error: Call to undefined function hikashop_loadUser()

Thank you very much for your great support, the support is what made me buy this cart and not another one...

Last edit: 14 years 8 months ago by [justaguy](/forum/user/6149-justaguy "View justaguy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 27
- Thank you received: 0
-
-

14 years 8 months ago [\#41515](#41515) by [justaguy](/forum/user/6149-justaguy "View justaguy's Profile")  Replied by *[justaguy](/forum/user/6149-justaguy "View justaguy's Profile")* on topic *[Re: show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#41515 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")*

ok, I got it working.
here is how I did it:
first, we need to insert the hikashop helper: Code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){ echo 'This module can not work without the Hikashop Component'; return; };

now, the call for the userid is a little different from what you wrote: Code:

$userhika = hikashop_loadUser(true); $user_id=$userhika-&gt;user_id;

the only difference is that you wrote hikashop_user_id and the correct syntax (at least with this helper.php file) is user_id.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 8 months ago [\#41518](#41518) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: show user id in front end](/forum/4-how-to/40809-show-user-id-in-front-end#41518 "Hi, First let me thank you all for a great support, i have learned so much building my system, and when it goes live i will share it with you. now for my question.  I would like to know if is there any why for me to present the user (after he logged in) every where in the website his hikashop&#95;user&#95;id.  I would like to know how to do that, as there are a couple of custom fields I need to present for the user but it's all connected to hikashop user id and not joomla.  Thanks for your help.")*

Indeed, it's user_id and not hikashop_user_id.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwODA5LXNob3ctdXNlci1pZC1pbi1mcm9udC1lbmQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.057 seconds

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