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

3

1 Answer 1

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.

1
  • Thanks! But need something more. Commented Jun 10, 2019 at 13:22

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.