File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Controller/Adminhtml/Category
view/adminhtml/web/catalog/category Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ public function execute()
38
38
39
39
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
40
40
$ resultJson = $ this ->resultJsonFactory ->create ();
41
- return $ resultJson ->setData (['id ' => $ categoryId , 'path ' => $ category ->getPath ()]);
41
+ return $ resultJson ->setData ([
42
+ 'id ' => $ categoryId ,
43
+ 'path ' => $ category ->getPath (),
44
+ 'parentid ' => $ category ->getParentID (),
45
+ ]);
42
46
}
43
47
}
44
48
}
Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ public function execute()
138
138
$ parentId = isset ($ categoryPostData ['parent ' ]) ? $ categoryPostData ['parent ' ] : null ;
139
139
if ($ categoryPostData ) {
140
140
$ category ->addData ($ categoryPostData );
141
+ if ($ parentId ) {
142
+ $ category ->setParentId ($ parentId );
143
+ }
141
144
if ($ isNewCategory ) {
142
145
$ parentCategory = $ this ->getParentCategory ($ parentId , $ storeId );
143
146
$ category ->setPath ($ parentCategory ->getPath ());
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ define([
14
14
options : {
15
15
categoryIdSelector : 'input[name="id"]' ,
16
16
categoryPathSelector : 'input[name="path"]' ,
17
+ categoryParentSelector : 'input[name="parent"]' ,
17
18
refreshUrl : config . refreshUrl
18
19
} ,
19
20
@@ -45,6 +46,7 @@ define([
45
46
} else {
46
47
$ ( this . options . categoryIdSelector ) . val ( data . id ) . change ( ) ;
47
48
$ ( this . options . categoryPathSelector ) . val ( data . path ) . change ( ) ;
49
+ $ ( this . options . categoryParentSelector ) . val ( data . parentid ) . change ( ) ;
48
50
}
49
51
}
50
52
} ;
You can’t perform that action at this time.
0 commit comments