55 \
Magento\Review\Model\RatingFactory $ratingFactory,
56 \
Magento\Review\Model\ReviewFactory $reviewFactory,
59 $this->_voteFactory = $voteFactory;
60 $this->_reviewFactory = $reviewFactory;
61 $this->_ratingFactory = $ratingFactory;
76 return $this->_coreRegistry->registry(
'current_product');
86 return $this->_coreRegistry->registry(
'current_review');
106 if (!$this->getRatingCollection()) {
107 $ratingCollection = $this->_voteFactory->create()->getResourceCollection()->setReviewFilter(
110 $this->_storeManager->getStore()->getId()
112 $this->_storeManager->getStore()->getId()
116 return $this->getRatingCollection();
126 if (!$this->getRatingSummaryCache()) {
127 $this->setRatingSummaryCache(
128 $this->_ratingFactory->create()->getEntitySummary($this->
getProductData()->getId())
131 return $this->getRatingSummaryCache();
141 if (!$this->getTotalReviewsCache()) {
142 $this->setTotalReviewsCache(
143 $this->_reviewFactory->create()->getTotalReviews(
146 $this->_storeManager->getStore()->getId()
150 return $this->getTotalReviewsCache();
161 return $this->
formatDate($date, \IntlDateFormatter::LONG);
175 $displayIfNoReviews =
false 177 if (!
$product->getRatingSummary()) {
178 $this->_reviewFactory->create()->getEntitySummary(
$product, $this->_storeManager->getStore()->getId());
formatDate( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
__construct(\Magento\Catalog\Block\Product\Context $context, \Magento\Review\Model\Rating\Option\VoteFactory $voteFactory, \Magento\Review\Model\RatingFactory $ratingFactory, \Magento\Review\Model\ReviewFactory $reviewFactory, array $data=[])
getUrl($route='', $params=[])
getReviewsSummaryHtml(\Magento\Catalog\Model\Product $product, $templateType=false, $displayIfNoReviews=false)