cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.1.7 - Showing Rating on Category Page

Magento 2.1.7 - Showing Rating on Category Page

I have been trying to show the rating on the category listing page. They show up if there is a rating, but I want rating to show even if there are no reviews (no stars).

In the list.phtml page i see:

<?php echo $block->getReviewsSummaryHtml($_product, $templateType, true); ?>

I also see the function

    public function aroundGetReviewsSummaryHtml(
    ListProduct $subject,    callable $proceed,    \Magento\Catalog\Model\Product $product,    $templateType = false,    $displayIfNoReviews = false)
{
    return $this->_helper->getCategoryShowReviews($subject->getMode())
        ? $proceed($product, $templateType, $displayIfNoReviews)
        : '';
}

I have tried a lot of things but can not get anything to show if there are no reviews. The end of the functions has a variable $displayIfNoReviews, but if i set this to true, still doesn't show.

Anyone have any ideas I can try? Thank you in advance.

1 REPLY

Re: Magento 2.1.7 - Showing Rating on Category Page

Anyone have any ideas?