そこで、商品ページに商品レビューを表示する方法を見つけました。ここで、表示されるレビューの数を制限し、製品レビューのデフォルト ページに「もっとレビューを読む」リンクを追加する方法を理解する必要があります。
何か案は?または、誰かが私を正しい方向に向けることができますか? さまざまなスクリプトを試してみましたが、うまくいきませんでした。
更新:以下の変更を試みましたが、まだ機能していません - 私が間違っていることについてのアイデアはありますか?
ええ、それは私が思ったことですが、まだ機能していません。私が間違っていることはありますか??
<?php $_items = $this->getReviewsCollection()->setPageSize('5')->getItems();?>
<div class="box-collateral box-reviews" id="customer-reviews">
<?php if (count($_items)):?>
<div class="box-title">
<h2><?php echo $this->__('Customer<br><span id="smallH2">Reviews</span>') ?></h2>
</div>
<?php echo $this->getChildHtml('toolbar') ?>
<dl class="box-content" id="product-reviews-list">
<?php foreach ($_items as $_review):?>
<dt>
<?php
$reviewURL = $this->getReviewUrl($_review->getId());
$reviewURL = str_replace("catalog","review",$reviewURL);
?>
<a href="<?php echo $reviewURL ?>"><?php echo $this->htmlEscape($_review->getTitle()) ?></a> <?php echo $this->__('Review by <span>%s</span>', $this->htmlEscape($_review->getNickname())) ?>
</dt>
<dd>
<table class="data-table review-summary-table">
<col />
<col />
<tbody>
<?php foreach ($_review->getRatingVotes() as $_vote): ?>
<tr>
<th class="label"><?php echo $this->escapeHtml($_vote->getRatingCode()) ?></th>
<td class="value">
<div class="rating-box">
<div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;">
</div>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p><?php echo nl2br($this->htmlEscape($_review->getDetail())) ?></p>
<p class="date"><?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?></p>
</dd>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateGeneric($$('#product-reviews-list dd'), ['last']);</script>
<?php endif;?>
<?php echo $this->getChildHtml('review_form') ?>
</div>