1

I want to display the products review below the product without Tab.

like this revies in the red box: enter image description here

enter image description here Please suggest something for the same

0

Try following code

<?php
$productId = '323'; // Product ID
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create("Magento\Catalog\Model\Product")->load($productId);
$storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStoreId = $storeManager->getStore()->getId();
$rating = $objectManager->get("Magento\Review\Model\ResourceModel\Review\CollectionFactory");

$collection = $rating->create()->addStoreFilter(
            $currentStoreId
        )->addStatusFilter(
            \Magento\Review\Model\Review::STATUS_APPROVED
        )->addEntityFilter(
            'product',
            $productId
        )->setDateOrder();

print_r($collection->getData());
            ?>

You will get review data in $collection->getData(). you can display as per your requirement.

Please let me know still if you face issue.

  • Thanks! But need something more. – SIDDHANT JAIN Jun 10 '19 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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