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)
1095
1095
if ($ rowData [self ::COL_CATEGORY ] == $ this ->getCategoryName ($ rowData )) {
1096
1096
// if _category eq. name then we don't have parents
1097
1097
$ 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 ];
1098
1102
} else {
1099
1103
$ categoryParts = $ this ->explodeEscaped ($ this ->_scopeConfig ->getValue (Config::XML_PATH_CATEGORY_PATH_SEPERATOR ), $ rowData [self ::COL_CATEGORY ]);
1100
1104
array_pop ($ categoryParts );
You can’t perform that action at this time.
0 commit comments