Code Duplication    Length = 6-6 lines in 2 locations

application/modules/navigation/navigation_widgets.php 2 locations

@@ 134-139 (lines=6) @@
131
                    $categories = $category->buildCategoryPath(Criteria::ASC, MY_Controller::getCurrentLocale());
132
                    $paths = [];
133
134
                    foreach ($categories as $category) {
135
                        $paths[] = [
136
                                    'path_url' => 'shop/category/' . $category->getFullPath(),
137
                                    'name'     => $category->getName(),
138
                                   ];
139
                    }
140
141
                    $tpl_data = ['navi_cats' => $paths];
142
                    return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
@@ 164-169 (lines=6) @@
161
                        $category = SCategoryQuery::create()->findOneById($product->getCategoryId());
162
                        $categories = $category->buildCategoryPath(Criteria::ASC, MY_Controller::getCurrentLocale());
163
164
                        foreach ($categories as $category) {
165
                            $path[] = [
166
                                       'path_url' => 'shop/category/' . $category->getFullPath(),
167
                                       'name'     => $category->getName(),
168
                                      ];
169
                        }
170
171
                        $path[] = [
172
                                   'path_url' => '',