Skip to main content

problem with username in comment form

More
8 years 11 months ago - 8 years 11 months ago #281520 by olive
-- 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: 8 years 11 months ago by olive.

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

More
8 years 11 months ago #281537 by Mohamed Thelji
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.

More
8 years 11 months ago #281711 by olive
I used this code:
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 :
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 } 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.

More
8 years 11 months ago - 8 years 11 months ago #281740 by Philip
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: 8 years 11 months ago by Philip.

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

More
8 years 11 months ago - 8 years 11 months ago #281889 by olive
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.
Last edit: 8 years 11 months ago by olive.

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

More
8 years 11 months ago #281890 by Jerome
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.

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

Time to create page: 0.248 seconds
Powered by Kunena Forum