Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Summary Rating stars not displaying anymore
 
erickisim
Jr. Member
 
Total Posts:  7
Joined:  2011-05-26
 

Im using this code on my products detail page in the ...theme\template\catalog\product\view.phtml file

<?php echo $this->getReviewsSummaryHtml($_productfalsetrue)?>

The rating summery stars are not working. I have the reviews set to just one option instead of the default 3 for my main store view.

Any Ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Do your ratings work in the default theme?

 
Magento Community Magento Community
Magento Community
Magento Community
 
matt7
Jr. Member
 
Total Posts:  2
Joined:  2011-02-13
 

I am having the same problem using the modern theme as well - it only shows the rating star for the first of each products on the category page.

Using <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?> protocol.  Nothing is being returned.

Go http://themotley.com/index.php/shave/shaving-creams.html and hover over the first product image and then the rest.

Any thoughts?  Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbender5555
Jr. Member
 
Total Posts:  5
Joined:  2009-03-09
 

Having the same problem as well.  Rating shows up only for first product in each category in both list and grid view.  Ratings work and display normally inside the actual product pages.  Occurs in default and third-party themes. 

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jimmyarmstrong
Jr. Member
 
Total Posts:  2
Joined:  2011-02-11
 

same here i tried inserting the product page <?php echo $this->getReviewsSummaryHtml($_product, false, true)?> same thing first product works then the rest show nothing, also with template paths on the template isn’t being called at all on the others even when i take out the if statement, anyone have a solution?!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mennobouma88
Jr. Member
 
Total Posts:  8
Joined:  2011-03-03
 

Try this solution in /template/catalog/product/list.phtml:

<?php
                    $_reviews 
Mage::getModel('review/review')->getResourceCollection();              
                      
$_reviews->addStoreFilterMage::app()->getStore()->getId() )  
                                ->
addEntityFilter('product'$_product->getId())
                              ->
addStatusFilterMage_Review_Model_Review::STATUS_APPROVED )  
                              ->
setDateOrder()  
                              ->
addRateVotes(); 
                    
                            
$avg 0
                            
$ratings = array(); 
                            if (
count($_reviews) > 0){
                            
foreach ($_reviews->getItems() as $_review): ?>
                            <?php 
foreach( $_review->getRatingVotes() as $_vote ): ?>
                                    <?php $ratings[] 
$_vote->getPercent();   ?>
                                <?php 
endforeach; ?>
                            <?php 
endforeach;   
                            
$avg array_sum($ratings)/count($ratings);  
                            ?> 
                     
                    
<div class="rating-box">  
                      <
div class="rating" style="width: <?php echo ceil($avg) ; ?>%;"></div>  
                    </
div>
                    
<?php endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
iTjensen
Jr. Member
 
Total Posts:  8
Joined:  2009-05-26
 

I am having the same problem - it only shows ratings for the first product, and nothing for the rest. I have tried the PHP-solution in #5, but the page just stops working.

I will return, if I find a solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gtmall
Jr. Member
 
Total Posts:  21
Joined:  2009-07-12
 
iTjensen - 08 September 2011 04:35 AM

I am having the same problem - it only shows ratings for the first product, and nothing for the rest. I have tried the PHP-solution in #5, but the page just stops working.

I will return, if I find a solution.

This is a reported bug.

open file: app/code/core/Mage/Catalog/Block/Product/Abstract.php

change:

protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
            
if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
                return 
true;
            
}
        }

        
return false;
    
}
to:
protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
if (!Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                
return false;
            
else {
                 $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
}
         }
return true;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
WebShopApps
Guru
 
Avatar
Total Posts:  460
Joined:  2008-05-30
London, UK
 

Many thanks, this solution works well.

Rgds

Karen

gtmall - 09 September 2011 02:08 AM


This is a reported bug.

open file: app/code/core/Mage/Catalog/Block/Product/Abstract.php

change:

protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
            
if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
                return 
true;
            
}
        }

        
return false;
    
}
to:
protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
if (!Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                
return false;
            
else {
                 $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
}
         }
return true;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
iTjensen
Jr. Member
 
Total Posts:  8
Joined:  2009-05-26
 

Thanks - it works very well! smile

gtmall - 09 September 2011 02:08 AM

iTjensen - 08 September 2011 04:35 AM
I am having the same problem - it only shows ratings for the first product, and nothing for the rest. I have tried the PHP-solution in #5, but the page just stops working.

I will return, if I find a solution.

This is a reported bug.

open file: app/code/core/Mage/Catalog/Block/Product/Abstract.php

change:

protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
            
if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
                return 
true;
            
}
        }

        
return false;
    
}
to:
protected function _initReviewsHelperBlock()
    
{
        
if (!$this->_reviewsHelperBlock{
if (!Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                
return false;
            
else {
                 $this
->_reviewsHelperBlock $this->getLayout()->createBlock('review/helper');
}
         }
return true;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

Anyone know if this is fixed in 1.6.1?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

@ladle:: Can you tell me if you stars show up on the default theme?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 
Brent W Peterson - 30 October 2011 10:09 AM

@ladle:: Can you tell me if you stars show up on the default theme?

Just checked on our test site, and NO it doesn’t work with default theme. 

Applied the fix in this thread to our live site, and it works well.  I’m assuming this is a core bug, and am curious if 1.6.1 fixes it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
caricarreira
Jr. Member
 
Total Posts:  5
Joined:  2011-12-16
 

It worked for me too! I was like 2 days trying to fix that! thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
gloopy
Jr. Member
 
Total Posts:  10
Joined:  2011-07-31
 

Don’t know if this is the same issue but i have the same problem and tried everything to get the stars to display in my reviews sidebar, they appear as a grey box :(

take a look here :- http://www.gloopy.co.uk/ipad-2-front-screen-repairs-uk/

as you can see the stars display correctly on the product but not in the sidebar even though they have the same css style

 
Magento Community Magento Community
Magento Community
Magento Community
 
raleshpatel
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-01-01
Ahmedabad
 

Nice work “gtmall” your code is work for me…

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top