In Magento 2, I need to get details of how many reviews approved in specific product and how many average ratings percentage of specific product.
How to get this both details ?
Please help me.
Thanks.
magento2product-reviewratings
In Magento 2, I need to get details of how many reviews approved in specific product and how many average ratings percentage of specific product.
How to get this both details ?
Please help me.
Thanks.
Best Answer
You need to inject
\Magento\Review\Model\ReviewFactory
and\Magento\Review\Model\Rating $ratingFactory
in your construct.Add this below code in your file :
Clean cache and refresh it. Hope it will helpful for you !!