- Posts: 16
- Thank you received: 0
Username in the Comments of the products
11 years 5 months ago - 11 years 5 months ago #200761
by vdevan
Username in the Comments of the products was created by vdevan
-- 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
-- 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
Last edit: 11 years 5 months ago by vdevan. Reason: english
Please Log in or Create an account to join the conversation.
11 years 5 months ago #200764
by Xavier
Replied by Xavier on topic Username in the Comments of the products
Hi,
Please edit the file "components/com_hikashop/views/vote/view.html.php", function "listing()" and replace:
By:
We updated the code on our end, this way it allow to only edit the view "vote / listing" and replace:
By:
Please edit the file "components/com_hikashop/views/vote/view.html.php", function "listing()" and replace:
Code:
$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;
Code:
$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:
Code:
<span class="hika_vote_listing_username"><?php echo $elt[$i]->username; ?> </span>
By:
Code:
<span class="hika_vote_listing_username"><?php echo $elt[$i]->name; ?> </span>
Please Log in or Create an account to join the conversation.
11 years 5 months ago #200807
by vdevan
Replied by vdevan on topic Username in the Comments of the products
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;
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.
11 years 5 months ago #200813
by Xavier
Replied by Xavier on topic Username in the Comments of the products
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.
Yes the line you wrote would have also worked
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.204 seconds