Magento评论“阅读更多”

时间:2015-08-14 10:39:21

标签: php magento magento-1.7

我在产品页面的标​​签中显示了Magento 1.7.0.2中的评论:

<?php $_items = $this->getReviewsCollection(5)->getItems(5);?>
    <div class="review">
        <?php //if (count($_items)):?>
            <h2><?php echo $this->__('Customer Reviews') ?></h2>
            <dl>
            <?php $i = 0 ?>
            <?php foreach ($_items as $_review):?>
            <?php $i++ ?>
            <?php if ($i < 11):?>
                    <dt>
                    <?php echo $this->__('Review by <span>%s</span>', $this->htmlEscape($_review->getNickname())) ?>
                    <?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?>
                    </dt>
                <dd>
                    <?php $_votes = $_review->getRatingVotes(); ?>
                    <?php if (count($_votes)): ?>
                    <table class="ratings-table">
                        <col width="1" />
                        <col />
                        <tbody>
                            <?php foreach ($_votes as $_vote): ?>
                            <tr>
                                <th><?php echo $this->escapeHtml($_vote->getRatingCode()) ?></th>
                                <td>
                                    <div class="rating-box">
                                        <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
                                    </div>
                                </td>
                            </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                    <?php endif; ?>

                    <?php if($this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') != "(Posted on 01/01/2011)"): ?>
                    <?php echo nl2br($this->htmlEscape($_review->getDetail())) ?><a href="#results">*</a>
                    <!--<small class="date"><?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?></small> -->
                    <?php endif; ?>
                </dd>
                <?php endif; ?>
            <?php endforeach; ?>

            </dl>

哪一项都运作正常,但由于这仅限于10条评论,我希望在产品视图页面顶部添加正常的评论链接“XX评论”但是我不知道如何在产品说明/标签中包含这个内容?有人能够对此有所了解吗?

由于

0 个答案:

没有答案