osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [résolu] première catégorie développée à l'arrivée
binsou
posté 25 Mar 2005, 16:35
Message #1


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 197
Inscrit : 27-October 04
Membre no 3595



Comment faire pour que la première catégorie parmi les catégories parentes soit développée ..au moins pour les entrées filles du premier niveau...lorsque l'on arrive sur le site?


--------------------
MS2 fr + infobox skin manager 2.0 + prodlistcol + enable disable categories + sitemap + colissimo suivi + chronopost + kelkoo 2.1 + image html package + robots1.1 + header tags + easypopulate + admin access level creload avec icones mavrick+ down for maintenance + customisation personnelle
Go to the top of the page
 
binsou
posté 28 Mar 2005, 16:38
Message #2


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 197
Inscrit : 27-October 04
Membre no 3595



Personne n'a une petite idée...

J'ai trouver ceci pour identifier la page de démarrage sur le forum :

CODE

if ( strstr($_SERVER['PHP_SELF'],'index.php')  && (!isset($_GET['cPath']) && !isset($_GET['manufacturers_id']) ) )  {  

} else {
require(DIR_WS_BOXES . 'shopping_cart.php');
}

ici on supprime le shopping cart..à adapter donc


Reste plus qu'à dérouler la première catégorie parente dans la construction de la boite catégorie...


--------------------
MS2 fr + infobox skin manager 2.0 + prodlistcol + enable disable categories + sitemap + colissimo suivi + chronopost + kelkoo 2.1 + image html package + robots1.1 + header tags + easypopulate + admin access level creload avec icones mavrick+ down for maintenance + customisation personnelle
Go to the top of the page
 
fissiaux
posté 28 Mar 2005, 18:33
Message #3


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Dans catalog/includes/boxes/categories.php,

Remplaces :

CODE
 if (tep_not_null($cPath)) {
   $new_path = '';
   reset($cPath_array);
   while (list($key, $value) = each($cPath_array)) {
     unset($parent_id);
     unset($first_id);
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id 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)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 }



par


CODE
 if (tep_not_null($cPath)) {
   $new_path = '';
   reset($cPath_array);
   while (list($key, $value) = each($cPath_array)) {
     unset($parent_id);
     unset($first_id);
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id 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)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 } else {
   
   $new_path = '';
   $cPath_array_new = tep_parse_category_path(1);  
   reset($cPath_array_new);
   while (list($key, $value) = each($cPath_array_new)) {
     unset($parent_id);
     unset($first_id);
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id 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)$languages_id ."' order by sort_order, cd.categories_name");
     if (tep_db_num_rows($categories_query)) {
       $new_path .= $value;
       while ($row = tep_db_fetch_array($categories_query)) {
         $tree[$row['categories_id']] = array('name' => $row['categories_name'],
                                              'parent' => $row['parent_id'],
                                              'level' => $key+1,
                                              'path' => $new_path . '_' . $row['categories_id'],
                                              'next_id' => false);

         if (isset($parent_id)) {
           $tree[$parent_id]['next_id'] = $row['categories_id'];
         }

         $parent_id = $row['categories_id'];

         if (!isset($first_id)) {
           $first_id = $row['categories_id'];
         }

         $last_id = $row['categories_id'];
       }
       $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
       $tree[$value]['next_id'] = $first_id;
       $new_path .= '_';
     } else {
       break;
     }
   }
 }



Je pense que le seul moyen est d'intervenir dans la boxe categories. Tu aurais pu faire autrement en codant ailleurs un cpath mais tu aurais perdu par la même la page d'accueil.
Dans le code ci-dessus, j'ai mis :

CODE
   $cPath_array_new = tep_parse_category_path(1);


Le 1 correspond à l'id de la categorie que tu veux déployer. Comme tu ne veux pas en faire une contribution, tu peux coder en dur l'id de ta catégorie. Donc tu remplaces la 1 par ta propre valeur.
Go to the top of the page
 
binsou
posté 28 Mar 2005, 20:13
Message #4


Ceinture orange OSC
Icône de groupe

Groupe : Membres
Messages : 197
Inscrit : 27-October 04
Membre no 3595



Une contribution sa doit etre possible...en mettant l'id de la categorie en define... biggrin.gif
Une contribution brut de décoffrage..sans paramétrage dans l'admin.

Merci pour la tienne en tout cas.
A moi d'adapter sa à ma box catégories..qui a déjà bien changé.


--------------------
MS2 fr + infobox skin manager 2.0 + prodlistcol + enable disable categories + sitemap + colissimo suivi + chronopost + kelkoo 2.1 + image html package + robots1.1 + header tags + easypopulate + admin access level creload avec icones mavrick+ down for maintenance + customisation personnelle
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 20th May 2013 - 06:20
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)