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

#   real name instead of username in Vote &amp; Comment

##

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

Less More

- Posts: 57
- Thank you received: 1
-
-

12 years 1 week ago [\#179501](#179501) by [888](/forum/user/32855-888 "View 888's Profile")  *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#179501 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")* was created by *[888](/forum/user/32855-888 "View 888's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.14-1

hi

How do i show real name instead of username in Vote &amp; Comment

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3Mjk4Ni1yZWFsLW5hbWUtaW5zdGVhZC1vZi11c2VybmFtZS1pbi12b3RlLWNvbW1lbnQ/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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86586
- Thank you received: 14325
-
-

12 years 1 week ago [\#179528](#179528) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#179528 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

Hi,

If you want to change the label of the "username" field to "real name" on the comment form, you can edit the file "form" of the view "vote" via the menu Display&gt;Views and change the code: Code:

&lt;?php echo JText::_('HIKA_USERNAME'); ?&gt;:

to: Code:

Real name:

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

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

Less More

- Posts: 78
- Thank you received: 5
-
-

4 years 11 months ago [\#337470](#337470) by [brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")  Replied by *[brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#337470 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

To update this for version 4.4.3....

The standard functionality seems to put the username in the vote_pseudo databse field in the table XX_hikashop_vote. I don't know of a setting that changes that, but let me know if I'm wrong, Nicolas.

Therefore, to change what is put in that field, this file needs to be adjusted: administrator/com_hikashop/classes/vote.php

Change:
Code:

$element-&gt;vote_pseudo = $user-&gt;username;

To
Code:

$element-&gt;vote_pseudo = $user-&gt;name;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3Mjk4Ni1yZWFsLW5hbWUtaW5zdGVhZC1vZi11c2VybmFtZS1pbi12b3RlLWNvbW1lbnQ/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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86586
- Thank you received: 14325
-
-

4 years 11 months ago -  4 years 4 months ago [\#337497](#337497) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#337497 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

Hi,

Yes, that's a way to go about it. However, doing it like that means that you'll have to redo the change after each update.
An alternative would be to develop a plugin with the onBeforeVoteCreate event to force the vote_pseudo value before it's saved in the database.
A simpler approach would be to leave it as is and instead modify the vote / listing.php view file via the menu Display&gt;Views to add the code: Code:

if(!empty($elt-&gt;vote_user_id)) { $userClass = hikashop_get('class.user'); $user = $userClass-&gt;get($elt-&gt;vote_user_id); if(!empty($user-&gt;name)) $elt-&gt;vote_pseudo = $user-&gt;name; }

after the line: Code:

foreach($this-&gt;elts as $elt) {

so that it can load dynamically the user's name from the user entry in the database on the comments listing on the frontend.

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

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

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

Less More

- Posts: 78
- Thank you received: 5
-
-

4 years 11 months ago [\#337501](#337501) by [brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")  Replied by *[brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#337501 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

Thanks, Nicolas. I'm assuming that is referring to the table XX_hikashop_vote, and for my install, it is putting IP addresses in the vote_user_id field...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3Mjk4Ni1yZWFsLW5hbWUtaW5zdGVhZC1vZi11c2VybmFtZS1pbi12b3RlLWNvbW1lbnQ/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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86586
- Thank you received: 14325
-
-

4 years 11 months ago [\#337525](#337525) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#337525 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

Hi,

The IP is set in the vote_user_id column either if you create the vote/comment from the backend, or if you create it on the frontend as a guest (since there is no user account that can be attached)
In such cases, your question of having the name or username displayed doesn't make sense since there is no user account linked to the vote/comment to get the name or the username from.

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

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

Less More

- Posts: 78
- Thank you received: 5
-
-

4 years 11 months ago [\#337553](#337553) by [brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")  Replied by *[brentwilliams2](/forum/user/1200-brentwilliams2 "View brentwilliams2's Profile")* on topic *[real name instead of username in Vote &amp; Comment](/forum/4-how-to/872986-real-name-instead-of-username-in-vote-comment#337553 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.14-1  hi  How do i show real name instead of username in Vote &amp; Comment")*

Ah, that makes sense. Thanks!

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

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