From e22e5da764af41c91aafbd81d64e170498ef5956 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Wed, 21 Oct 2020 23:22:17 +0200 Subject: [PATCH] On modifie le module mesCategories... --- .idea/workspace.xml | 484 ++++++++++++------ modules/mesCategories/mesCategories.php | 11 +- .../views/templates/hook/displayHome.tpl | 26 +- 3 files changed, 368 insertions(+), 153 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3b305c13..f2ddbf3a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -11,107 +11,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + + + + + + @@ -120,63 +34,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -185,27 +168,48 @@ + + + + + + + + + + + + + + + + + + + + + @@ -216,42 +220,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -260,35 +305,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,62 +378,73 @@ + - - + + - - - - - + + + + + - + - - + + - + - - + + - - - + + + - - + + - + - - + + - + - - + + - - + + - - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + @@ -393,11 +493,6 @@ - - - - - @@ -405,6 +500,16 @@ + + + + + + + + + + @@ -427,7 +532,8 @@ - + + 1602059851601 @@ -464,7 +570,14 @@ - @@ -491,39 +604,120 @@ - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + + + + + + + + + + + file://$PROJECT_DIR$/modules/mesCategories/mesCategories.php + 232 + + + file://$PROJECT_DIR$/modules/mesCategories/mesCategories.php + 226 + + + \ No newline at end of file diff --git a/modules/mesCategories/mesCategories.php b/modules/mesCategories/mesCategories.php index 1f957c86..b3daf0cf 100644 --- a/modules/mesCategories/mesCategories.php +++ b/modules/mesCategories/mesCategories.php @@ -223,9 +223,16 @@ class MesCategories extends Module public function hookDisplayHome() { + $categories = Category::getHomeCategories((int)$this->context->language->id, true); + foreach ($categories as $category) { + if (Category::hasChildren($category[id_category], (int)$this->context->language->id, true)) { + $children = Category::getChildren($category[id_category], (int)$this->context->language->id, true); + array_push($subcategories, [$children]); + } + } $this->smarty->assign(array( - 'categories' => CMSCategory::getCategories(), -// 'sub-categories' => Category::getChildren(), + 'categories' => $categories, + 'sub-categories' => $subcategories, )); return $this->display(__FILE__, 'displayHome.tpl'); diff --git a/modules/mesCategories/views/templates/hook/displayHome.tpl b/modules/mesCategories/views/templates/hook/displayHome.tpl index 95bf951f..30443747 100644 --- a/modules/mesCategories/views/templates/hook/displayHome.tpl +++ b/modules/mesCategories/views/templates/hook/displayHome.tpl @@ -3,12 +3,26 @@
    {foreach from=$categories item=category name=category_list}
  • - {$category.id} -{* {foreach from=$sub-categories item=sub-category name=subcategory_list}*} -{* {/foreach}*} - - {* *} -{* *} + categorie : {$category.name} + {if $category.image.large.url} +
    + {if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if} +
    + {/if} +
    + +
  • {/foreach}