problem with username in comment form

  • Posts: 7
  • Thank you received: 0
6 years 5 months ago #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 "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
<?php echo $elt->vote_pseudo; ?>
to
<?php echo $elt->name; ?>
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: 6 years 5 months ago by olive.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
6 years 5 months ago #281537

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->vote_user_id is set or not :
if(isset($elt->vote_user_id))

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
6 years 5 months ago #281711

I used this code:

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

instead of :
		<td class="hika_comment_listing_name">
<?php if ($elt->vote_pseudo == '0') { ?>
			<span class="hika_vote_listing_username"><?php echo $elt->username; ?> </span>
<?php } else { ?>
			<span class="hika_vote_listing_username" ><?php echo $elt->vote_pseudo; ?></span>
<?php } ?>
		</td>
but it doesn't solve the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 4502
  • Thank you received: 610
  • MODERATOR
6 years 5 months ago #281740

Hello,

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



=> Results in my front end on my product page



Here, you see that everybody can vote & 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: 6 years 5 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
6 years 5 months ago #281889

Hi again
No, It's not my mean. let to start from the begining:
In configuration:



then when user register it just enter email and password:



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



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



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.

Attachments:
Last edit: 6 years 5 months ago by olive.

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 5 months ago #281890

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum