Logical error in vote/mini.php

  • Posts: 382
  • Thank you received: 77
8 years 1 month ago #251717

-- HikaShop version -- : 2.6.4

Hi,

I tested the new version Hikashop (2.6.4) and got the wrong display of the product pages.

I spent some time to check it and now I found a reason of it.

There is an logical error in vote/mini.php view.

Here is lines 65-85:

if ($row->hikashop_vote_total_vote > 0) {
?>
	<div style="display: none;">
		<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
			<span itemprop="ratingValue"><?php echo $row->hikashop_vote_average_score; ?></span>
			<span itemprop="bestRating"><?php echo $row->hikashop_vote_nb_star; ?></span>
			<span itemprop="ratingCount"><?php echo $row->hikashop_vote_total_vote; ?></span>
			<span itemprop="itemReviewed">Product</span>
		</div>
	</div>
	<div class="hk-rating" data-original-title="<?php echo $tooltip; ?>" data-toggle="hk-tooltip">
<?php
	}
	for($i = 1; $i <= $row->hikashop_vote_average_score_rounded; $i++) {
		echo '<span class="hk-rate-star state-full"></span>';
	}
	for($i = $row->hikashop_vote_average_score_rounded; $i < $row->hikashop_vote_nb_star; $i++) {
		echo '<span class="hk-rate-star state-empty"></span>';
	}
?>
	</div>

If ($row->hikashop_vote_total_vote > 0) is wrong, we have </div> without <div class="hk-rating"...

And I did it so:
if ($row->hikashop_vote_total_vote > 0) {
?>
	<div style="display: none;">
		<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
			<span itemprop="ratingValue"><?php echo $row->hikashop_vote_average_score; ?></span>
			<span itemprop="bestRating"><?php echo $row->hikashop_vote_nb_star; ?></span>
			<span itemprop="ratingCount"><?php echo $row->hikashop_vote_total_vote; ?></span>
			<span itemprop="itemReviewed">Product</span>
		</div>
	</div>
<?php
	}
?>
	<div class="hk-rating" data-original-title="<?php echo $tooltip; ?>" data-toggle="hk-tooltip">
<?php
	for($i = 1; $i <= $row->hikashop_vote_average_score_rounded; $i++) {
		echo '<span class="hk-rate-star state-full"></span>';
	}
	for($i = $row->hikashop_vote_average_score_rounded; $i < $row->hikashop_vote_nb_star; $i++) {
		echo '<span class="hk-rate-star state-empty"></span>';
	}
?>
	</div>

Best regards

Last edit: 8 years 1 month ago by almika.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #251776

Hi,

Thanks for the feedback. You're totally right. We've changed that on our end.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum