Vote Mini not refreshing

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #231659

-- HikaShop version -- : 2.6.1

Hello,

I have a problem with the voting, it's not refreshing like it has before and it's not recognising that I've voted at all. I can keep on voting as many times as I like. Could you please help?

Many thanks,
Hal

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #231686

Hi,

I just tried on your website, on one of your product page and it is working fine.
The votes are now using Ajax so the page is not refreshed, only the vote parts are.

If you submit one vote and hover the stars, you will see a popup with all the informations of the votes.

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

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #231702

Hi Xavier,

Thanks for your help. The problem is that you can vote as many times as you like. I just pressed is 5 times and got 5 votes...

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #231738

Hi,

I was not able to reproduce the issue on my local.
Do you have view overrides or something like that ?

Could you give us a screenshot of your vote settings ?
That way we will maybe be able to test with the same parameters.

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

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #231780

Hello,

There are view overrides, this is the code:

<?php
/**
* @package HikaShop for Joomla!
* @version 2.6.1
* @author hikashop.com
* @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$row =& $this->rows;
$config = hikashop_config();
if($row->vote_enabled != 1)
return;

$voteAccess = $config->get('access_vote','public');
$user = (!is_null(hikashop_loadUser()))?hikashop_loadUser():false;
$hasBought = false;
if($voteAccess == 'buyed' && $user){
$voteClass = hikashop_get('class.vote');
$hasBought = $voteClass->hasBought($row->vote_ref_id, $user);
}
$canVote = $voteAccess == 'public' || ($voteAccess == 'registered' && $user) || ($voteAccess == 'buyed' && $hasBought);

$row->hikashop_vote_average_score = (float)hikashop_toFloat($row->hikashop_vote_average_score);
JRequest::setVar("rate_rounded",$row->hikashop_vote_average_score_rounded);
JRequest::setVar("nb_max_star",$row->hikashop_vote_nb_star);
$select_id = "select_id_".$row->vote_ref_id;
if(!empty($row->main_div_name)){
$select_id .= "_".$row->main_div_name;
}else{
$select_id .= "_hikashop_main_div_name";
}
if($row->hikashop_vote_total_vote == '0'){
$tooltip = JText::_('HIKA_NO_VOTE');
}else{
$user_rating = JText::_('HIKA_NO_VOTE');
if(isset($this->user_vote->vote_rating))
$user_rating = $this->user_vote->vote_rating;
$tooltip = JText::sprintf('HIKA_VOTE_TOOLTIP',$row->hikashop_vote_average_score,$row->hikashop_vote_total_vote,$user_rating);
}

?>
<div class="hikashop_vote_stars">
<?php
if($config->get('enable_status_vote', 'vote') != 'both' && $canVote) {
?>
<input type="hidden" name="hikashop_vote_rating" data-votetype="<?php echo $row->type_item; ?>" data-max="<?php echo $row->hikashop_vote_nb_star; ?>" data-ref="<?php echo $row->vote_ref_id;?>" data-rate="<?php echo $row->hikashop_vote_average_score_rounded; ?>" data-original-title="<?php echo $tooltip; ?>" id="<?php echo $select_id;?>" />
<span id="hikashop_vote_status_<?php echo $row->vote_ref_id;?>" class="hikashop_vote_notification_mini"></span>
<?php
} else {
?>
<div class="ui-rating" data-original-title="<?php echo $tooltip; ?>" data-toggle="hk-tooltip">
<?php
for($i = 1; $i <= $row->hikashop_vote_average_score_rounded; $i++) {
echo '<a class="ui-rating-star ui-rating-full"></a>';
}
for($i = $row->hikashop_vote_average_score_rounded; $i < $row->hikashop_vote_nb_star; $i++) {
echo '<a class="ui-rating-star ui-rating-empty"></a>';
}
?>
</div>
<?php
}
?>
<input type="hidden" class="hikashop_vote_rating" data-rate="<?php echo $row->hikashop_vote_average_score_rounded; ?>" />
</div>

I have also attached a screenshot of the settings?

Thanks for your help.

Many thanks,
Hal

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #231804

Hi,

The best would be to try to backup the override and do a test with the default content of the view. (so remove the override).
That way we will be sure if it is causing this issue or not.

ps: the screenshot of the settings is missing.

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

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #231848

Ok thanks,

I deleted the customisation and it's working fine now. I just hope that it doesn't affect something else :)

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

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #232625

Hello again,

For some reason, it's allowing the user to make as many votes as the like. No customisations are present either..

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #232632

Hi,

I just tried on my local with the latest 2.6.1 version, with the same settings than you and I don't have this issue.

So I tried on your site and see that there is a javascript error related on the votes but not in our vote.js file.
The file in question is generated by "plazart-assets", please try to disable that component/plugin and try again.

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

  • Posts: 265
  • Thank you received: 1
9 years 6 months ago #232757

Ok thanks, I've passed it onto the developer.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum