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

#   problem with username in comment form

##

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 11 months ago -  8 years 11 months ago [\#281520](#281520) by [olive](/forum/user/47308-olive "View olive's Profile")  *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281520 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")* was created by *[olive](/forum/user/47308-olive "View olive's Profile")*

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.7.2
-- PHP version -- : 5.6

Hi
In the comment form , if user comment for the product , It shows the username,
the problem is when you select "Simplified registration" in configuration.
In registration, it saves the email as username,
and in comment form it shows the email as username, but we don't like the others khnow the email of user,
In the "\vote\listing.php" file I changed the
&lt;?php echo $elt-&gt;vote_pseudo; ?&gt;
to
&lt;?php echo $elt-&gt;name; ?&gt;
It solves the problem for the user if they logged in before they comment
but if guest comment in the product it doesn't show anything,
I don't know how to slove this problem

Last edit: 8 years 11 months ago by [olive](/forum/user/47308-olive "View olive's Profile").

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 11 months ago [\#281537](#281537) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281537 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")*

Hello,

In that case the solution will probably be to directly check if the comment was posted from a logged in user or not.

You'll be able to do it by checking if the variable $elt-&gt;vote_user_id is set or not :
if(isset($elt-&gt;vote_user_id))

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 11 months ago [\#281711](#281711) by [olive](/forum/user/47308-olive "View olive's Profile")  Replied by *[olive](/forum/user/47308-olive "View olive's Profile")* on topic *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281711 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")*

I used this code: Code:

&lt;td class="hika_comment_listing_name"&gt; &lt;?php if ($elt-&gt;vote_pseudo == '0') { ?&gt; &lt;span class="hika_vote_listing_username"&gt;&lt;?php echo $elt-&gt;username; ?&gt; &lt;/span&gt; &lt;?php } elseif(isset($elt-&gt;vote_user_id)) { ?&gt; &lt;span class="hika_vote_listing_username" &gt;&lt;?php echo $elt-&gt;name; ?&gt;&lt;/span&gt; &lt;?php } else{ ?&gt; &lt;span class="hika_vote_listing_username" &gt;&lt;?php echo $elt-&gt;vote_pseudo; ?&gt;&lt;/span&gt; &lt;?php } ?&gt; &lt;/td&gt;

instead of : Code:

&lt;td class="hika_comment_listing_name"&gt; &lt;?php if ($elt-&gt;vote_pseudo == '0') { ?&gt; &lt;span class="hika_vote_listing_username"&gt;&lt;?php echo $elt-&gt;username; ?&gt; &lt;/span&gt; &lt;?php } else { ?&gt; &lt;span class="hika_vote_listing_username" &gt;&lt;?php echo $elt-&gt;vote_pseudo; ?&gt;&lt;/span&gt; &lt;?php } ?&gt; &lt;/td&gt;

but it doesn't solve the problem.

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

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 654
-
-

8 years 11 months ago -  8 years 11 months ago [\#281740](#281740) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281740 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")*

Hello,

There is something I don't get about this topic, see my screenshot to better understand my point of view :
**=&gt;** First settings of Vote &amp; Comment :

[ ![&#91;img  ](https://cdn.pbrd.co/images/GRMYy77.png) ](https://cdn.pbrd.co/images/GRMYy77.png "&#91;img  ")

**=&gt;** Results in my front end on my product page

[ ![&#91;img  ](https://cdn.pbrd.co/images/GRMYx9P.png) ](https://cdn.pbrd.co/images/GRMYx9P.png "&#91;img  ")

Here, you see that everybody can **vote &amp; comment**, and **add a user name** each time a comment is posted.
So, this way allow everybody to comment and **if** your customer is logged the name input **isn't display**.
Hope this will fit your needs.

Regards

Last edit: 8 years 11 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 11 months ago -  8 years 11 months ago [\#281889](#281889) by [olive](/forum/user/47308-olive "View olive's Profile")  Replied by *[olive](/forum/user/47308-olive "View olive's Profile")* on topic *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281889 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")*

Hi again
No, It's not my mean. let to start from the begining:
In configuration:
[ ![11.jpg](/forum/attachment/41227) ](/forum/attachment/41227 "11.jpg")

then when user register it just enter email and password:

[ ![12.jpg](/forum/attachment/41228) ](/forum/attachment/41228 "12.jpg")

account information is created and "email" = "username"

[ ![14.jpg](/forum/attachment/41229) ](/forum/attachment/41229 "14.jpg")

then user loged in the site and comments in product page
and you see email of him,

[ ![13.jpg](/forum/attachment/41226) ](/forum/attachment/41226 "13.jpg")

It's the problem that we don't like to show email of user.
I used the solution that I explain in first post , but it makes another problem for guest.

- [ ![13.jpg](/forum/attachment/41226) ](/forum/attachment/41226 "13.jpg") [ ](/forum/attachment/41226?download=1 "13.jpg")
- [ ![11.jpg](/forum/attachment/41227) ](/forum/attachment/41227 "11.jpg") [ ](/forum/attachment/41227?download=1 "11.jpg")
- [ ![12.jpg](/forum/attachment/41228) ](/forum/attachment/41228 "12.jpg") [ ](/forum/attachment/41228?download=1 "12.jpg")
- [ ![14.jpg](/forum/attachment/41229) ](/forum/attachment/41229 "14.jpg") [ ](/forum/attachment/41229?download=1 "14.jpg")

Last edit: 8 years 11 months ago by [olive](/forum/user/47308-olive "View olive's Profile").

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

8 years 11 months ago [\#281890](#281890) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[problem with username in comment form](/forum/42-vote/892576-problem-with-username-in-comment-form#281890 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.2 -- PHP version -- : 5.6  Hi In the comment form , if user comment for the product , It shows the username, the problem is when you select &quot;Simplified registration&quot; in configuration. In registration, it saves the email as username, and in comment form it shows the email as username, but we don't like the others khnow the email of user, In the &quot;&#92;vote&#92;listing.php&quot; file I changed the vote&#95;pseudo; ?&gt; to name; ?&gt; It solves the problem for the user if they logged in before they comment but if guest comment in the product it doesn't show anything, I don't know how to slove this problem")*

Hello,

> I used the solution that I explain in first post , but it makes another problem for guest.

Yes, that is why the view display that "vote_pseudo" variable ; because it is where the information about the username is stored.
Now you can see to change your code to display the name and fallback on the "vote_pseudo" if that field is empty.

Regards,

---

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

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

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

[](#top)
