Bonjour,
alors pour celles et ceux que ça intéresse, voici la solution pour avoir plusieurs BOX catégories sans passer par EZpages et en contrôlant l'affichage depuis l'admin

En premier lieu dupliquez les box categories.php et tpl_categories.php qui se trouvent respectivement dans "boutique"/modules/sideboxes et dans "boutique"/includes/templates/votre_template/sideboxes.
Enregistrez les dans les mêmes dossiers sous par exemple : categorie2.php et tpl_categories2.php
éditez le fichier : "boutique"/includes/classes/category_tree.php
recherchez les lignes : and c.categories_status= 1
sous ces lignes ajoutez : and c.sort_order<=1000
vous devez trouver 4 lignes a ajouter !!
à la ligne 145 vous trouverez un } sous l'accolade, coller ceci :
//debut de la deuxieme box catégories
function zen_seconde_tree($product_type = "all") {
global $db, $cPath, $cPath_array;
if ($product_type != 'all') {
$sql = "select type_master_type from " . TABLE_PRODUCT_TYPES . "
where type_master_type = " . $product_type . "";
$master_type_result = $db->Execute($sql);
$master_type = $master_type_result->fields['type_master_type'];
}
$this->tree = array();
if ($product_type == 'all') {
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.parent_id = 0
and c.categories_id = cd.categories_id
and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
and c.categories_status= 1
and c.sort_order>= 1001
order by sort_order, cd.categories_name";
} else {
$categories_query = "select ptc.category_id as categories_id, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc
where c.parent_id = 0
and ptc.category_id = cd.categories_id
and ptc.product_type_id = " . $master_type . "
and c.categories_id = ptc.category_id
and cd.language_id=" . (int)$_SESSION['languages_id'] ."
and c.categories_status= 1
and c.sort_order>= 1001
order by sort_order, cd.categories_name";
}
$categories = $db->Execute($categories_query, '', true, 150);
while (!$categories->EOF) {
$this->tree[$categories->fields['categories_id']] = array('name' => $categories->fields['categories_name'],
'parent' => $categories->fields['parent_id'],
'level' => 0,
'path' => $categories->fields['categories_id'],
'image' => $categories->fields['categories_image'],
'next_id' => false);
if (isset($parent_id)) {
$this->tree[$parent_id]['next_id'] = $categories->fields['categories_id'];
}
$parent_id = $categories->fields['categories_id'];
if (!isset($first_element)) {
$first_element = $categories->fields['categories_id'];
}
$categories->MoveNext();
}
if (zen_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
unset($parent_id);
unset($first_id);
if ($product_type == 'all') {
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.parent_id = " . (int)$value . "
and c.categories_id = cd.categories_id
and cd.language_id=" . (int)$_SESSION['languages_id'] . "
and c.categories_status= 1
and c.sort_order>= 1001
order by sort_order, cd.categories_name";
} else {
/*
$categories_query = "select ptc.category_id as categories, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc
where c.parent_id = '" . (int)$value . "'
and ptc.category_id = cd.categories_id
and ptc.product_type_id = '" . $master_type . "'
and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
and c.categories_status= '1'
order by sort_order, cd.categories_name";
*/
$categories_query = "select ptc.category_id as categories_id, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc
where c.parent_id = " . (int)$value . "
and ptc.category_id = cd.categories_id
and ptc.product_type_id = " . $master_type . "
and c.categories_id = ptc.category_id
and cd.language_id=" . (int)$_SESSION['languages_id'] ."
and c.categories_status= 1
and c.sort_order>= 1001
order by sort_order, cd.categories_name";
}
$rows = $db->Execute($categories_query);
if ($rows->RecordCount()>0) {
$new_path .= $value;
while (!$rows->EOF) {
$this->tree[$rows->fields['categories_id']] = array('name' => $rows->fields['categories_name'],
'parent' => $rows->fields['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $rows->fields['categories_id'],
'image' => $categories->fields['categories_image'],
'next_id' => false);
if (isset($parent_id)) {
$this->tree[$parent_id]['next_id'] = $rows->fields['categories_id'];
}
$parent_id = $rows->fields['categories_id'];
if (!isset($first_id)) {
$first_id = $rows->fields['categories_id'];
}
$last_id = $rows->fields['categories_id'];
$rows->MoveNext();
}
$this->tree[$last_id]['next_id'] = $this->tree[$value]['next_id'];
$this->tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
$row = 0;
return $this->zen_show_category($first_element, $row);
}
ENREGISTEZ ET FERMER CE FICHIER.
Ouvrir categories2.php
recherchez :
$box_categories_array = $main_category_tree->zen_category_tree();
et remplacez le par :
$box_categories_array = $main_category_tree->zen_seconde_tree();
recherchez:
require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
remplacez par :
require($template->get_template_dir('tpl_categories2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories2.php');
recherchez :
$title = BOX_HEADING_CATEGORIES
;
remplacez :
$title = BOX_HEADING_CATEGORIES_SECONDE;
enregistrez et fermez.
Allez dans votre administration, activez la nouvelle box dans outils/controles des blocs
Maintenant, toujours dans l'admin, catalogue/categories et produits
toutes les catégories que vous voulez dans la 1ere box, doivent avoir un classement inferieur ou égal à 1000
toutes les catégories que vous voulez dans la 2eme box, doivent avoir un classement superieur ou égal à 1001
pour changer le Nom de cette nouvelle catégories, ouvrez le fichier dans includes/langages/french.php
recherchez:
define('BOX_HEADING_CATEGORIES', 'Catégories');
dessous mettez
define('BOX_HEADING_CATEGORIES_SECONDE', 'Le Nom de votre BOX');
Enjoy :p