Skip to content

Commit 8db7885

Browse files
committed
Merge remote-tracking branch 'rog/issue-36208' into AC-6761
2 parents 98fb0dc + acab048 commit 8db7885

File tree

1 file changed

+19
-1
lines changed
  • app/code/Magento/Catalog/Block/Adminhtml/Category/Tab

1 file changed

+19
-1
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
use Magento\Catalog\Model\Product\Visibility;
1919
use Magento\Framework\App\ObjectManager;
2020

21+
/**
22+
* Class Product in category grid
23+
*/
2124
class Product extends \Magento\Backend\Block\Widget\Grid\Extended
2225
{
2326
/**
24-
* Core registry
27+
* Core registry model
2528
*
2629
* @var \Magento\Framework\Registry
2730
*/
@@ -68,6 +71,8 @@ public function __construct(
6871
}
6972

7073
/**
74+
* Initialize object
75+
*
7176
* @return void
7277
*/
7378
protected function _construct()
@@ -79,6 +84,8 @@ protected function _construct()
7984
}
8085

8186
/**
87+
* Get current category
88+
*
8289
* @return array|null
8390
*/
8491
public function getCategory()
@@ -87,6 +94,8 @@ public function getCategory()
8794
}
8895

8996
/**
97+
* Add column filter to collection
98+
*
9099
* @param Column $column
91100
* @return $this
92101
*/
@@ -110,6 +119,8 @@ protected function _addColumnFilterToCollection($column)
110119
}
111120

112121
/**
122+
* Prepare collection.
123+
*
113124
* @return Grid
114125
*/
115126
protected function _prepareCollection()
@@ -136,6 +147,7 @@ protected function _prepareCollection()
136147
'left'
137148
);
138149
$storeId = (int)$this->getRequest()->getParam('store', 0);
150+
$collection->setStoreId($storeId);
139151
if ($storeId > 0) {
140152
$collection->addStoreFilter($storeId);
141153
}
@@ -153,6 +165,8 @@ protected function _prepareCollection()
153165
}
154166

155167
/**
168+
* Prepare columns.
169+
*
156170
* @return Extended
157171
*/
158172
protected function _prepareColumns()
@@ -230,6 +244,8 @@ protected function _prepareColumns()
230244
}
231245

232246
/**
247+
* Retrieve grid reload url
248+
*
233249
* @return string
234250
*/
235251
public function getGridUrl()
@@ -238,6 +254,8 @@ public function getGridUrl()
238254
}
239255

240256
/**
257+
* Get selected products
258+
*
241259
* @return array
242260
*/
243261
protected function _getSelectedProducts()

0 commit comments

Comments
 (0)