@@ -16,7 +16,7 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\Shopcart
16
16
/**
17
17
* @var \Magento\Reports\Model\Resource\Quote\CollectionFactory
18
18
*/
19
- protected $ _quotesFactory ;
19
+ protected $ quoteItemCollectionFactory ;
20
20
21
21
/**
22
22
* @var \Magento\Quote\Model\QueryResolver
@@ -26,18 +26,18 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\Shopcart
26
26
/**
27
27
* @param \Magento\Backend\Block\Template\Context $context
28
28
* @param \Magento\Backend\Helper\Data $backendHelper
29
- * @param \Magento\Reports\Model\Resource\Quote\CollectionFactoryInterface $quotesFactory
29
+ * @param \Magento\Reports\Model\Resource\Quote\Item\CollectionFactory $quoteItemCollectionFactory
30
30
* @param \Magento\Quote\Model\QueryResolver $queryResolver
31
31
* @param array $data
32
32
*/
33
33
public function __construct (
34
34
\Magento \Backend \Block \Template \Context $ context ,
35
35
\Magento \Backend \Helper \Data $ backendHelper ,
36
- \Magento \Reports \Model \Resource \Quote \CollectionFactoryInterface $ quotesFactory ,
37
36
\Magento \Quote \Model \QueryResolver $ queryResolver ,
37
+ \Magento \Reports \Model \Resource \Quote \Item \CollectionFactory $ quoteItemCollectionFactory ,
38
38
array $ data = []
39
39
) {
40
- $ this ->_quotesFactory = $ quotesFactory ;
40
+ $ this ->quoteItemCollectionFactory = $ quoteItemCollectionFactory ;
41
41
$ this ->queryResolver = $ queryResolver ;
42
42
parent ::__construct ($ context , $ backendHelper , $ data );
43
43
}
@@ -56,7 +56,8 @@ protected function _construct()
56
56
*/
57
57
protected function _prepareCollection ()
58
58
{
59
- $ collection = $ this ->_quotesFactory ->create ();
59
+ /** @var \Magento\Reports\Model\Resource\Quote\Item\Collection $collection */
60
+ $ collection = $ this ->quoteItemCollectionFactory ->create ();
60
61
$ collection ->prepareActiveCartItems ();
61
62
$ this ->setCollection ($ collection );
62
63
return parent ::_prepareCollection ();
@@ -68,11 +69,11 @@ protected function _prepareCollection()
68
69
protected function _prepareColumns ()
69
70
{
70
71
$ this ->addColumn (
71
- 'entity_id ' ,
72
+ 'product_id ' ,
72
73
[
73
74
'header ' => __ ('ID ' ),
74
75
'align ' => 'right ' ,
75
- 'index ' => 'entity_id ' ,
76
+ 'index ' => 'product_id ' ,
76
77
'sortable ' => false ,
77
78
'header_css_class ' => 'col-id ' ,
78
79
'column_css_class ' => 'col-id '
@@ -146,6 +147,6 @@ protected function _prepareColumns()
146
147
*/
147
148
public function getRowUrl ($ row )
148
149
{
149
- return $ this ->getUrl ('catalog/product/edit ' , ['id ' => $ row ->getEntityId ()]);
150
+ return $ this ->getUrl ('catalog/product/edit ' , ['id ' => $ row ->getProductId ()]);
150
151
}
151
152
}
0 commit comments