-- 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