18
18
use Magento \Catalog \Model \Product \Visibility ;
19
19
use Magento \Framework \App \ObjectManager ;
20
20
21
+ /**
22
+ * Class Product in category grid
23
+ */
21
24
class Product extends \Magento \Backend \Block \Widget \Grid \Extended
22
25
{
23
26
/**
24
- * Core registry
27
+ * Core registry model
25
28
*
26
29
* @var \Magento\Framework\Registry
27
30
*/
@@ -68,6 +71,8 @@ public function __construct(
68
71
}
69
72
70
73
/**
74
+ * Initialize object
75
+ *
71
76
* @return void
72
77
*/
73
78
protected function _construct ()
@@ -79,6 +84,8 @@ protected function _construct()
79
84
}
80
85
81
86
/**
87
+ * Get current category
88
+ *
82
89
* @return array|null
83
90
*/
84
91
public function getCategory ()
@@ -87,6 +94,8 @@ public function getCategory()
87
94
}
88
95
89
96
/**
97
+ * Add column filter to collection
98
+ *
90
99
* @param Column $column
91
100
* @return $this
92
101
*/
@@ -110,6 +119,8 @@ protected function _addColumnFilterToCollection($column)
110
119
}
111
120
112
121
/**
122
+ * Prepare collection.
123
+ *
113
124
* @return Grid
114
125
*/
115
126
protected function _prepareCollection ()
@@ -136,6 +147,7 @@ protected function _prepareCollection()
136
147
'left '
137
148
);
138
149
$ storeId = (int )$ this ->getRequest ()->getParam ('store ' , 0 );
150
+ $ collection ->setStoreId ($ storeId );
139
151
if ($ storeId > 0 ) {
140
152
$ collection ->addStoreFilter ($ storeId );
141
153
}
@@ -153,6 +165,8 @@ protected function _prepareCollection()
153
165
}
154
166
155
167
/**
168
+ * Prepare columns.
169
+ *
156
170
* @return Extended
157
171
*/
158
172
protected function _prepareColumns ()
@@ -230,6 +244,8 @@ protected function _prepareColumns()
230
244
}
231
245
232
246
/**
247
+ * Retrieve grid reload url
248
+ *
233
249
* @return string
234
250
*/
235
251
public function getGridUrl ()
@@ -238,6 +254,8 @@ public function getGridUrl()
238
254
}
239
255
240
256
/**
257
+ * Get selected products
258
+ *
241
259
* @return array
242
260
*/
243
261
protected function _getSelectedProducts ()
0 commit comments