2017-07-15 7 views

答えて

1

親カテゴリをトップメニューから非表示にするオプションがあります。カテゴリ> [カテゴリを編集]> [データ]タブに移動すると、下の画像が表示されます。

top

しかし、唯一の親カテゴリのために働くだろうと、それはモニターのような子カテゴリのために動作させるためにオプション上記

は、下記の手順:

Goは を/catalog/controller/common/header.php提出します検索用語 'top'を入力すると、1回の出現が確認され、以下のコードが書き込まれます。

foreach ($categories as $category) { 
     if ($category['top']) { 
     //...... some code written 
     } 
} 

あなたは

foreach ($categories as $category) { 
     if ($category['top']) { 
     //...... some code written 
      foreach ($children as $child) { 
       if ($child['top']) { // **YOU HAVE TO ADD IF CONDITION** 
       $filter_data = array(
        'filter_category_id' => $child['category_id'], 
        'filter_sub_category' => true 
       ); 

       $children_data[] = array(
        'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 
        'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) 
       ); 
       } 
      } 
     //...some extra code written 
     } 
} 

、各カテゴリのためにではなく、モニターにマークトップを行って以下のように編集コードブロックを持っています。

関連する問題