File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1095,6 +1095,10 @@ protected function getParentCategory($rowData)
10951095 if ($ rowData [self ::COL_CATEGORY ] == $ this ->getCategoryName ($ rowData )) {
10961096 // if _category eq. name then we don't have parents
10971097 $ parent = false ;
1098+ } elseif (is_numeric ($ rowData [self ::COL_CATEGORY ]) && isset ($ this ->categoriesWithRoots [$ rowData [self ::COL_ROOT ]][$ rowData [self ::COL_CATEGORY ]])) {
1099+ // existing category given via ID, retrieve correct parent
1100+ $ categoryParts = explode ('/ ' , $ this ->categoriesWithRoots [$ rowData [self ::COL_ROOT ]][$ rowData [self ::COL_CATEGORY ]][CategoryModel::KEY_PATH ]);
1101+ $ parent = $ categoryParts [count ($ categoryParts ) - 2 ];
10981102 } else {
10991103 $ categoryParts = $ this ->explodeEscaped ($ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ), $ rowData [self ::COL_CATEGORY ]);
11001104 array_pop ($ categoryParts );
You can’t perform that action at this time.
0 commit comments