Bhaveshpp

Professional Magento Developr - Healp eachother to grow

After install porto theme Error on sub-category page

22 May 2021 » magento2, composer

Error:


1 exception(s):
Exception #0 (Exception): Recoverable Error: Object of class Magento\Framework\DataObject could not be converted to string in /vendor/magento/framework/Escaper.php on line 261

#3 Magento\Review\Block\Product\ReviewRenderer\Interceptor->escapeHtmlAttr(&Magento\Framework\DataObject#00000000367d9542000000007e094784#) called at [app/design/frontend/Smartwave/porto_child/Magento_Review/templates/helper/summary_short.phtml:18]

Solution:

app/design/frontend/Smartwave/porto_child/Magento_Review/templates/helper/summary_short.phtml on line 18

    <?php
        if (is_string($block->getRatingSummary())) {
         $rating = $block->getRatingSummary();
        } else {
         $rating = $block->getRatingSummary()->getRatingSummary();
        }
    ?>