[SOLVED] Hide grey voting stars for guests

  • Posts: 181
  • Thank you received: 10
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Standard Hikashop Business
1 year 1 week ago #289280

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5

Hi,

We allow only registered people to vote.
How hard would it be to hide the grey stars for people who are not logged in?
Could this done by applying a different style when people are a guest?
Or maybe there is a way to accomplish this in Hikashop in a different way?

Thanks,
Nico

Last edit: 1 year 1 week ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 65077
  • Thank you received: 9449
  • MODERATOR
1 year 1 week ago #289289

Hi,

I've checked your link but I don't see any grey star on your product pages.
So I'm not sure what you're talking about.
Could you provide more details please ?

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

  • Posts: 181
  • Thank you received: 10
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Standard Hikashop Business
1 year 1 week ago #289325

Hi Nicolas,

Ik mean the same grey stars/votes as on your demo page :
https://demo.hikashop.com/index.php/en/hikashop/products-listing/display-in-div
The grey stiletto's don't have any votes so there are 5 grey stars.
If this is the case the customer would like to hide them for "guests" and only show the yellow stars.
It would not be a problem to hide the grey stars in general but then you cannot vote anymore :-)

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

  • Posts: 65077
  • Thank you received: 9449
  • MODERATOR
1 year 1 week ago #289340

Hi,

Add the code:

if(!$canVote && $row->hikashop_vote_total_vote == '0'){
	echo '<div class="hikashop_vote_stars">'.JText::_('HIKA_NO_VOTE').'</div>';
	return;
}
after the line:
$canVote = $voteAccess == 'public' || ($voteAccess == 'registered' && !empty($user)) || ($voteAccess == 'buyed' && $hasBought);
in the view file vote / mini.php and people who can't vote won't see stars on products without any vote.
You can then restrict the voting to registered users with the "Choose the access level for votes or comments" setting.

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

  • Posts: 181
  • Thank you received: 10
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Standard Hikashop Business
1 year 1 week ago #289360

Hi Nicolas,

That brilliant, thanks !

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

Time to create page: 0.061 seconds
Powered by Kunena Forum