File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed
Catalog/Block/Adminhtml/Product/Edit/Button
Customer/Block/Adminhtml/Edit/Tab Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 11
11
class Back extends Generic
12
12
{
13
13
/**
14
+ * Get Button Data
15
+ *
14
16
* @return array
15
17
*/
16
18
public function getButtonData ()
17
19
{
18
20
return [
19
21
'label ' => __ ('Back ' ),
20
- 'on_click ' => sprintf ("location.href = '%s'; " , $ this ->getUrl ( ' */*/ ' )),
22
+ 'on_click ' => sprintf ("location.href = '%s'; " , $ this ->getBackUrl ( )),
21
23
'class ' => 'back ' ,
22
24
'sort_order ' => 10
23
25
];
24
26
}
27
+ /**
28
+ * Get URL for back
29
+ *
30
+ * @return string
31
+ */
32
+ private function getBackUrl ()
33
+ {
34
+ if ($ this ->context ->getRequestParam ('customerId ' )) {
35
+ return $ this ->getUrl (
36
+ 'customer/index/edit ' ,
37
+ ['id ' => $ this ->context ->getRequestParam ('customerId ' )]
38
+ );
39
+ }
40
+ return $ this ->getUrl ('*/*/ ' );
41
+ }
25
42
}
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public function __construct(
75
75
}
76
76
77
77
/**
78
- * { @inheritdoc}
78
+ * @inheritdoc
79
79
*/
80
80
protected function _construct ()
81
81
{
@@ -119,7 +119,7 @@ protected function _prepareCollection()
119
119
}
120
120
121
121
/**
122
- * { @inheritdoc}
122
+ * @inheritdoc
123
123
*/
124
124
protected function _prepareColumns ()
125
125
{
@@ -201,7 +201,7 @@ public function getCustomerId()
201
201
}
202
202
203
203
/**
204
- * { @inheritdoc}
204
+ * @inheritdoc
205
205
*/
206
206
public function getGridUrl ()
207
207
{
@@ -224,7 +224,13 @@ public function getGridParentHtml()
224
224
*/
225
225
public function getRowUrl ($ row )
226
226
{
227
- return $ this ->getUrl ('catalog/product/edit ' , ['id ' => $ row ->getProductId ()]);
227
+ return $ this ->getUrl (
228
+ 'catalog/product/edit ' ,
229
+ [
230
+ 'id ' => $ row ->getProductId (),
231
+ 'customerId ' => $ this ->getCustomerId ()
232
+ ]
233
+ );
228
234
}
229
235
230
236
/**
You can’t perform that action at this time.
0 commit comments