NoteStar 5 tahun lalu
induk
melakukan
b6ad9c518e

+ 0 - 3
addons/fecmall/furnilife_theme/app/appfront/theme/furnilife/catalog/category/index.php

@@ -59,9 +59,6 @@
                                 'filter_category' => $filter_category,
                                 'current_category'=> $name,
                             ];
-
-                            print_r($filter_category);
-
                             echo Yii::$service->page->widget->render('category/filter_subcategory', $parentThis);
                             ?>
                             <!-- category sidebar end -->

+ 9 - 3
vendor/fancyecommerce/fecshop/services/category/CategoryMysqldb.php

@@ -489,9 +489,14 @@ class CategoryMysqldb extends Service implements CategoryInterface
             'parent_id'  => $currentCategory['parent_id'],
         ];
         if ($currentCategory['parent_id']) {
-            $allParent = $this->getParentCategory($currentCategory['parent_id']);
-            $allParent[] = $returnData['current'];
-            $data = $this->getAllParentCate($allParent);
+            $allChild = $this->getChildCategory( $currentId);
+            if(is_array($allChild) && !empty($allChild)){
+                $data = $this->getAllParentCate($allChild);
+            }else{
+                $allParent[] = $returnData['current'];
+                $data = $this->getAllParentCate($allParent);
+            }
+
         } else {
             $data = $this->getOneLevelCateChild($returnData['current']);
         }
@@ -592,6 +597,7 @@ class CategoryMysqldb extends Service implements CategoryInterface
             'status' => $this->getCategoryEnableStatus(),
             'menu_show'  => $this->getCategoryMenuShowStatus(),
         ])->all();
+        print_r($category_id);
         $arr = [];
         if (is_array($data) && !empty($data)) {
             foreach ($data as $one) {