1
namespace Magento\Review\Block\Product\ReviewRenderer;

if ($product->getRatingSummary() === null) {
        $this->reviewSummaryFactory->create()->appendSummaryDataToObject(
            $product,
            $this->_storeManager->getStore()->getId()
        );
}

this is Magento2.3.3 review renderer Block code its rating starts not shwoing on home page but when i comment this line

//  if ($product->getRatingSummary() === null) {

its shows on home page is it right solution can any one guide or its a Magento2.3.3 bug

1 Answer 1

0

can you tried to put '==' instead of '===' cause I read here https://github.com/sentientmachine/php_equality_charts

if not then you have to try if(!empty($product->getRatingSummary())){

6
  • if(!empty($product->getRatingSummary())){ this worked but it is magento2.3.3
    – dfsd
    Commented Dec 5, 2019 at 6:55
  • magento 2.3.3 well support php :) Commented Dec 5, 2019 at 7:02
  • then what this mean === this is core code of magento2.3.3
    – dfsd
    Commented Dec 5, 2019 at 7:03
  • if ($product->getRatingSummary() === null || !empty($product->getRatingSummary())) {
    – dfsd
    Commented Dec 5, 2019 at 7:35
  • if ($product->getRatingSummary() === null || !empty($product->getRatingSummary())) { this is fine? because its working
    – dfsd
    Commented Dec 5, 2019 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.