title: magento - Show product reviews in review summary
body: <p>I am trying to redesign the review summary for the product page, so it shows the list of reviews and the form to add a new review.</p>
  
  <p>The form works, but the list does not.  I add the summary from view.phtml like this: </p>
  
  <pre><code>&lt;?php echo $this-&gt;getReviewsSummaryHtml($_product, false, true)?&gt;
  </code></pre>
  
  <p>My summary.phtml file return this error:</p>
  
  <blockquote>
    <p><code>Fatal error: Call to a member function getItems() on a non-object in /home/content/41/6755141/html/keepwell/buy/app/design/frontend/fvm/default/template/review/helper/summary.phtml</code></p>
  </blockquote>
  
  <p>for this line:</p>
  
  <pre><code>&lt;?php $_items = $this-&gt;getReviewsCollection()-&gt;getItems();?&gt;
  </code></pre>
  
  <p>My summary.phtml file looks like this:</p>
  
  <pre><code>&lt;div id="column-one-left"&gt;
  
  &lt;?php if ($this-&gt;getReviewsCount()): ?&gt;
  
      &lt;p class="title-noline"&gt;&lt;?php echo $this-&gt;__('Customer Reviews') ?&gt;&lt;/p&gt;
  
      &lt;div id="customer-reviews"&gt;
  
      &lt;?php $_items = $this-&gt;getReviewsCollection()-&gt;getItems();?&gt;
      &lt;?php if (count($_items)):?&gt;
          &lt;?php echo $this-&gt;getChildHtml('toolbar') ?&gt;
          &lt;dl&gt;
          &lt;?php foreach ($_items as $_review):?&gt;
  
              &lt;div class="review"&gt;
                  &lt;p class="review-title"&gt;&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getTitle()) ?&gt;&lt;/p&gt;
                  &lt;p class="review-name"&gt;&lt;?php echo $this-&gt;__('by &lt;span&gt;%s&lt;/span&gt;', $this-&gt;htmlEscape($_review-&gt;getNickname())) ?&gt;&lt;/p&gt;
                  &lt;p class="review-body"&gt;&lt;?php echo nl2br($this-&gt;htmlEscape($_review-&gt;getDetail())) ?&gt;&lt;/p&gt;
              &lt;/div&gt;
              &lt;hr class="review" /&gt;
  
              &lt;dt&gt;
                  &lt;a href="&lt;?php echo $this-&gt;getReviewUrl($_review-&gt;getId()) ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getTitle()) ?&gt;&lt;/a&gt; 
              &lt;/dt&gt;
              &lt;dd&gt;
                  &lt;?php $_votes = $_review-&gt;getRatingVotes(); ?&gt;
                  &lt;?php if (count($_votes)): ?&gt;
                  &lt;table class="ratings-table"&gt;
                      &lt;col width="1" /&gt;
                      &lt;col /&gt;
                      &lt;tbody&gt;
                          &lt;?php foreach ($_votes as $_vote): ?&gt;
                          &lt;tr&gt;
                              &lt;th&gt;&lt;?php echo $this-&gt;escapeHtml($_vote-&gt;getRatingCode()) ?&gt;&lt;/th&gt;
                              &lt;td&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;?php endif; ?&gt;
                  &lt;?php echo nl2br($this-&gt;htmlEscape($_review-&gt;getDetail())) ?&gt;
                  &lt;small class="date"&gt;&lt;?php echo $this-&gt;__('(Posted on %s)', $this-&gt;formatDate($_review-&gt;getCreatedAt()), 'long') ?&gt;&lt;/small&gt;
              &lt;/dd&gt;
          &lt;?php endforeach; ?&gt;
          &lt;/dl&gt;
          &lt;?php echo $this-&gt;getChildHtml('toolbar') ?&gt;
      &lt;?php endif;?&gt;
  
          &lt;div class="review"&gt;
  
              &lt;p class="review-title"&gt;This is the Review Title / Summary&lt;/p&gt;
              &lt;p class="review-name"&gt;by John Q. Doe&lt;/p&gt;
              &lt;p class="review-body"&gt;Nunc hendrerit, nisi eget adipiscing hendrerit, enim mauris elementum nibh, nec ornare nisi neque in quam. Vivamus ac ligula a felis hendrerit euismod. Etiam condimentum semper massa, ac bibendum diam lacinia ut. Nullam porttitor porttitor mi in sodales. Ut a vestibulum eros.&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;hr class="review" /&gt;
  
      &lt;/div&gt;
  
      &lt;hr/&gt;
      &lt;hr/&gt;
  
      &lt;div class="ratings"&gt;
  
          &lt;?php if ($this-&gt;getRatingSummary()):?&gt;
              &lt;div class="rating-box"&gt;
                  &lt;div class="rating" style="width:&lt;?php echo $this-&gt;getRatingSummary() ?&gt;%"&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;?php endif;?&gt;
  
          &lt;p class="rating-links"&gt;
              &lt;a href="&lt;?php echo $this-&gt;getReviewsUrl() ?&gt;"&gt;&lt;?php echo $this-&gt;__('%d Review(s)', $this-&gt;getReviewsCount()) ?&gt;&lt;/a&gt;
              &lt;span class="separator"&gt;|&lt;/span&gt;
              &lt;a href="&lt;?php echo $this-&gt;getReviewsUrl() ?&gt;#review-form"&gt;&lt;?php echo $this-&gt;__('Add Your Review') ?&gt;&lt;/a&gt;
          &lt;/p&gt;
  
      &lt;/div&gt;
  
  &lt;?php elseif ($this-&gt;getDisplayIfEmpty()): ?&gt;
      &lt;p class="title-noline"&gt;&lt;?php echo $this-&gt;__('Be the first to review this product') ?&gt; &gt;&gt;&lt;/p&gt;
  &lt;?php endif; ?&gt;
  
  &lt;/div&gt;
  
  
  &lt;div id="column-one-right"&gt;
  
  &lt;?php  echo $this-&gt;getLayout()-&gt;createBlock('review/form')-&gt;setBlockId('product.review.form')-&gt;toHtml();  ?&gt;
  
  &lt;/div&gt;
  </code></pre>