0

左側のサイドバーにすべてのカテゴリとサブカテゴリを表示するように一部の osCommerce コードを変更しましたが、正常に機能しています。

残念ながら、ホームページで製品を非表示にしています。osCommerce サイトのデフォルトのホームページでは、その月の商品を取得し、すべての商品を表示しています。

以下で行った変更のステップ 2 を回避すると、製品は表示されますが、左側のナビゲーションにはすべてのカテゴリとサブカテゴリが表示されません。

手順:

  1. index.php - 37 行目あたりを変更:

    if ($category_depth == 'nested') {
    

    に:

    if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
    
  2. includes/application_top.php - 437行目あたりを変更:

    $cPath = '';
    

    に:

     $cPath = '22';
    
  3. includes/modules/boxes/bm_categories.php - 99行目あたりを探します:

     $parent_id = $categories['categories_id'];
    

    追加:

     $dbs[] = $categories['categories_id'];
    
  4. includes/modules/boxes/bm_categories.php - 109行目あたりを変更:

     while (list($key, $value) = each($cPath_array)) {
    

    に:

     while (list($key, $value) = each($dbs)) {
    

なぜ問題が起こっているのですか?

4

2 に答える 2

1
function  single_genealogy($category,  $level  =  0){
              global $tree, $categories_string;
        // the sons of the current node = the IDs that are matched with this parentid
            $q  =  "select c.categories_id, cd.categories_name, c.parent_id from categories c , categories_description cd
             where c.parent_id ='".$category."' and c.categories_id = cd.categories_id order by sort_order , cd.categories_name";
             $r  =  mysql_query($q);  //or  die/mail/echo  mysql_error()
               $level++;
             $categories_string .= "<ul>";
               while($d  =  mysql_fetch_row($r)){
                    $cPath_new = 'cPath='.$d[0];
                 $categories_string .=  '<li><a href='.tep_href_link(FILENAME_DEFAULT, $cPath_new).'>'.$d[1].'</a>';
                 //displaying  current  node  :  $d[1]
                  //recursive  call  :
                 $this->single_genealogy($d[0],  $level);
echo "</li>";
                }
            $categories_string .=  "</ul>";    
        }


You need to put this function in bm_categories and call this function in getData()
and you simply find your all categories tree of product.
And now for applying navigation effect using css and jquery you can use www.htmldrive.net
于 2011-10-08T11:07:07.507 に答える
0

2番目のステップを次のように変更します。

$cPath = '0';

あなたが今持っているものは$cPath = '22';、無効なカテゴリIDを参照しています。

デフォルトのカテゴリパスIDを一番上(ゼロ(0))に設定すると、問題が修正され、デフォルトでその月の新製品が表示されます。

その値を子カテゴリIDに変更した場合、そのカテゴリの製品がメインページにデフォルトで表示されます。

于 2011-03-24T13:48:53.557 に答える