是什么导致我在Magento的评级重复?

时间:2012-03-12 04:03:31

标签: magento magento-1.5 php

为什么我的评分有重复值?

enter image description here

下面是我的 view.phtml 外观。我正在使用Magento“ ver.1.6.0.0

<?php if( $this->getRating() && $this->getRating()->getSize()): ?>
            <h3><?php echo $this->__('Product Rating:') ?></h3>
            <table class="ratings-table">
            <?php foreach ($this->getRating() as $_rating): ?>
                <?php if($_rating->getPercent()): ?>
                    <tr>
                        <th><?php echo $this->__($this->escapeHtml($_rating->getRatingCode())) ?></th>
                        <td>
                            <div class="rating-box">
                                <div class="rating" style="width:<?php echo ceil($_rating->getPercent()) ?>%;"></div>
                            </div>
                        </td>
                    </tr>
                <?php endif; ?>
            <?php endforeach; ?>
            </table>
            </dl>
        <?php endif; ?>

2 个答案:

答案 0 :(得分:3)

这似乎是您数据库中的问题。如果您从示例数据开始并在管理面板中删除了这些评论,则表格不会被删除。因此'review_id'被写入数据库两次。

备份数据库后,请按照以下步骤操作:

首先删除表'review_detail'中的所有样本评论。请记住已删除评论的“review_id”。

现在在表'rating_option_vote'中删除上面带有'review_id'列表的所有行。

答案 1 :(得分:1)

你在后端检查你的配置了吗?目录下 - &gt;评论和评分 - &gt;管理评级。也许他们是双重配置。否则它似乎是一个数据问题。

欢呼声