Note that there are some explanatory texts on larger screens.

plurals
  1. POlimit number of product reveiws that display on product page magento
    primarykey
    data
    text
    <p>So i have figured out how to display product reviews on a product page. Now I need to understand how to limit the number of review that display and add a "read more reviews" link to the product reviews default page.</p> <p>Any ideas? Or Can anyone point me in the right direction? I have tried a number of different scripts with no luck.</p> <p>UPDATE: I tried making the changes below but its still not working - any ideas on what i'm doing wrong?</p> <p>Yeah thats what I thought, but its still not working, any ideas what i'm doing wrong??</p> <pre><code>&lt;?php $_items = $this-&gt;getReviewsCollection()-&gt;setPageSize('5')-&gt;getItems();?&gt; &lt;div class="box-collateral box-reviews" id="customer-reviews"&gt; &lt;?php if (count($_items)):?&gt; &lt;div class="box-title"&gt; &lt;h2&gt;&lt;?php echo $this-&gt;__('Customer&lt;br&gt;&lt;span id="smallH2"&gt;Reviews&lt;/span&gt;') ?&gt;&lt;/h2&gt; &lt;/div&gt; &lt;?php echo $this-&gt;getChildHtml('toolbar') ?&gt; &lt;dl class="box-content" id="product-reviews-list"&gt; &lt;?php foreach ($_items as $_review):?&gt; &lt;dt&gt; &lt;?php $reviewURL = $this-&gt;getReviewUrl($_review-&gt;getId()); $reviewURL = str_replace("catalog","review",$reviewURL); ?&gt; &lt;a href="&lt;?php echo $reviewURL ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getTitle()) ?&gt;&lt;/a&gt; &lt;?php echo $this-&gt;__('Review by &lt;span&gt;%s&lt;/span&gt;', $this-&gt;htmlEscape($_review-&gt;getNickname())) ?&gt; &lt;/dt&gt; &lt;dd&gt; &lt;table class="data-table review-summary-table"&gt; &lt;col /&gt; &lt;col /&gt; &lt;tbody&gt; &lt;?php foreach ($_review-&gt;getRatingVotes() as $_vote): ?&gt; &lt;tr&gt; &lt;th class="label"&gt;&lt;?php echo $this-&gt;escapeHtml($_vote-&gt;getRatingCode()) ?&gt;&lt;/th&gt; &lt;td class="value"&gt; &lt;div class="rating-box"&gt; &lt;div class="rating" style="width:&lt;?php echo $_vote-&gt;getPercent() ?&gt;%;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php endforeach; ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;&lt;?php echo nl2br($this-&gt;htmlEscape($_review-&gt;getDetail())) ?&gt;&lt;/p&gt; &lt;p class="date"&gt;&lt;?php echo $this-&gt;__('(Posted on %s)', $this-&gt;formatDate($_review-&gt;getCreatedAt()), 'long') ?&gt;&lt;/p&gt; &lt;/dd&gt; &lt;?php endforeach; ?&gt; &lt;/dl&gt; &lt;script type="text/javascript"&gt;decorateGeneric($$('#product-reviews-list dd'), ['last']);&lt;/script&gt; &lt;?php endif;?&gt; &lt;?php echo $this-&gt;getChildHtml('review_form') ?&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload