Username in the Comments of the products

  • Posts: 16
  • Thank you received: 0
8 years 10 months ago #200761

-- url of the page with the problem -- : brahas.com
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

Hi:
The comment section uses "username" field for displaying the user who has commented. Since most people log in using Google+ which uses email as their username, the comment field displays the email address. Not a desirable option as we are not supposed to expose user emails. Is there a way to display "name" field instead of "username"? If there is a config or php changes required, please do let me know.
I am sure this is something other user would have asked as well. as it is a security requirement these days to avoid spams.
Thanks in advance for your help

Attachments:
Last edit: 8 years 10 months ago by vdevan. Reason: english

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #200764

Hi,

Please edit the file "components/com_hikashop/views/vote/view.html.php", function "listing()" and replace:

					$elts[$i] = new stdClass();
					$elts[$i]->vote_comment = $hikashop_vote->vote_comment;
					$elts[$i]->vote_rating = $hikashop_vote->vote_rating;
					$elts[$i]->vote_pseudo = $hikashop_vote->vote_pseudo;
					$elts[$i]->username = $hikashop_vote->username;
					$elts[$i]->vote_id = $hikashop_vote->vote_id;
					$elts[$i]->vote_user_id = $hikashop_vote->vote_user_id;
					$elts[$i]->vote_useful = $hikashop_vote->vote_useful;
					$elts[$i]->total_vote_useful = 0;
By:
					$elts[$i] = clone($hikashop_vote);
					$elts[$i]->total_vote_useful = 0;

We updated the code on our end, this way it allow to only edit the view "vote / listing" and replace:
<span class="hika_vote_listing_username"><?php echo $elt[$i]->username; ?> </span>

By:
<span class="hika_vote_listing_username"><?php echo $elt[$i]->name; ?> </span>

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

  • Posts: 16
  • Thank you received: 0
8 years 10 months ago #200807

Thanks Xavier. It worked like a charm.
Two things, what will happen if there is an upgrade. You mentioned that you have made the corrections from your end. I wasn't clear. so in future, the corrections will be in place?
Second, just for my own curiosity as I am not a php programmer, addition of following line would have also worked - right?
$elts[$i]->name = $hikashop_vote->name;

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #200813

Hi,

Yes the line you wrote would have also worked :) But the given solution allow to have all the informations directly.

When updating/upgrading, if you have edited the view thanks to the menu Display > Views (so a view override) so everything will work as expected.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum