Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-review
Block
Product
View
ListView.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Review\Block\Product\View
;
7
14
class
ListView
extends
\Magento\Review\Block\Product\View
15
{
20
protected
$_forceHasOptions
=
false
;
21
27
public
function
getProductId
()
28
{
29
$product
= $this->_coreRegistry->registry(
'product'
);
30
return
$product
?
$product
->getId() :
null
;
31
}
32
38
protected
function
_prepareLayout
()
39
{
40
parent::_prepareLayout();
41
42
$toolbar = $this->
getLayout
()->getBlock(
'product_review_list.toolbar'
);
43
if
($toolbar) {
44
$toolbar->setCollection($this->
getReviewsCollection
());
45
$this->
setChild
(
'toolbar'
, $toolbar);
46
}
47
48
return
$this;
49
}
50
56
protected
function
_beforeToHtml
()
57
{
58
$this->
getReviewsCollection
()->load()->addRateVotes();
59
return
parent::_beforeToHtml();
60
}
61
68
public
function
getReviewUrl
(
$id
)
69
{
70
return
$this->
getUrl
(
'*/*/view'
, [
'id'
=>
$id
]);
71
}
72
}
Magento\Review\Block\Product\View\ListView
Definition:
ListView.php:14
Magento\Review\Block\Product\View\ListView\_prepareLayout
_prepareLayout()
Definition:
ListView.php:38
Magento\Review\Block\Product\View
Definition:
View.php:17
Magento\Review\Block\Product\View\ListView\getReviewUrl
getReviewUrl($id)
Definition:
ListView.php:68
Magento\Review\Block\Product\View\ListView\$_forceHasOptions
$_forceHasOptions
Definition:
ListView.php:20
$id
$id
Definition:
fieldset.phtml:14
Magento\Review\Block\Product\View\getReviewsCollection
getReviewsCollection()
Definition:
View.php:122
Magento\Review\Block\Product\View\ListView\getProductId
getProductId()
Definition:
ListView.php:27
Magento\Framework\View\Element\AbstractBlock\getUrl
getUrl($route='', $params=[])
Definition:
AbstractBlock.php:773
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\Review\Block\Product\View
Definition:
ListView.php:6
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Review\Block\Product\View\ListView\_beforeToHtml
_beforeToHtml()
Definition:
ListView.php:56
Magento\Framework\View\Element\AbstractBlock\setChild
setChild($alias, $block)
Definition:
AbstractBlock.php:358