バージョン選択

フォーラム

メニュー

オンライン状況

15 人のユーザが現在オンラインです。 (8 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 15
もっと...

サイト内検索

その他 > その他 > パンくずリストの表示

その他

新規スレッドを追加する

スレッド表示 | 古いものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
NSX
投稿日時: 2007/8/17 10:27
対応状況: −−−
常連
登録日: 2007/7/31
居住地:
投稿: 61
Re: パンくずリストの表示
どうもありがとうございます。
無事表示できました。

しかし、今のまでは商品を選択したときしかパンくずリストが表示できないので、カテゴリーを選んだ時でも表示するようにしたいのですが、

html/user_data/templates/list.tpl


<a href="<!--{$smarty.const.SITE_URL}-->">HOME</a>
<!--{if $arrProduct.root_category_id != $arrProduct.parent_category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.root_category_id}-->"><!--{$root_category_name}--></a>
<!--{/if}-->
<!--{if $arrProduct.parent_category_id != $arrProduct.category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.parent_category_id}-->"><!--{$parent_category_name}--></a>
<!--{/if}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.category_id}-->"><!--{$category_name}--></a>
> <!--{$arrProduct.name|escape}-->

を記入したんですが、HOME>>しか表示されませんでした。

lsit.phpもやはり触るでしょうか?

できましたら、リスト表示時もパンくずリストを表示したいのでよろしくお願いします。

現在はこんな感じです。
http://usmc.jp/
NSX
投稿日時: 2007/8/17 10:20
対応状況: −−−
常連
登録日: 2007/7/31
居住地:
投稿: 61
Re: パンくずリストの表示
無事表示されました!
どうもありがとうございます。

user_data / templates / detail.tpl

<H2></H2>
のすぐ下に記入すると表示できますよ。
がんばってくださいね。
ゲスト
投稿日時: 2007/8/17 2:31
対応状況: −−−
Re: パンくずリストの表示
初心者でわからないのですが
**********************
商品詳細ページに

<!--{$category_name}-->
**********************
とございますが
商品詳細ページとかいてありますが
user_data / templates / detail.tpl
のファイルの表示したいところに
下記を入れればよろしいいのでしょうか?

***************************************
<a href="<!--{$smarty.const.SITE_URL}-->">HOME</a>
<!--{if $arrProduct.root_category_id != $arrProduct.parent_category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.root_category_id}-->"><!--{$root_category_name}--></a>
<!--{/if}-->
<!--{if $arrProduct.parent_category_id != $arrProduct.category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.parent_category_id}-->"><!--{$parent_category_name}--></a>
<!--{/if}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.category_id}-->"><!--{$category_name}--></a>
> <!--{$arrProduct.name|escape}-->

ゲスト
投稿日時: 2007/8/15 1:07
対応状況: −−−
Re: パンくずリストの表示
再三アドバイスいただきまして本当にありがとうございます。
ご提示された通りに /products/detail.php に追記してみたところ、見事に完動いたしました。
私事ですが、これの実現を目指して1週間ほど試行錯誤していましたので大変嬉しい限りです。重ねてお礼を申し上げます。
今後は「何故、この順番だと動くのか?」を理解できるようになるため PHP の勉強をしたいと思います。

なおこのスレッドを立てた方の目標は、より深い階層までのパンくずリスト実現のようですので、対応状況を勝手に「解決済」にしないでおきます。
cotetsu
投稿日時: 2007/8/15 0:23
対応状況: −−−
半人前
登録日: 2007/4/24
居住地:
投稿: 23
Re: パンくずリストの表示
バージョンが古い(1.3.0-beta)ままなのと何故そこに追記したのか経緯を忘れたので参考程度に。。


//この商品を買った人はこんな商品も買っています
// パンくずリスト用
// 拡大画像のウィンドウサイズをセット
//---------------------------------------------
/* 親カテゴリの取得 */
/* ルートカテゴリの取得 */
/* ファイル情報の初期化 */


の順番にしてるみたいでした。
ゲスト
投稿日時: 2007/8/14 22:38
対応状況: −−−
Re: パンくずリストの表示
8-12 に投稿した者です。お返事いただきましてありがとうございます。
早速アドバイスいただいたことを試してみたところ、当方の環境では以下のような挙動となりました。

・ /products/detail.php の末尾に追記
トップページへのリンクと {$arrProduct.name|escape} 以外が表示されない。
表示の概要:「HOME > > >(商品名)」

・ /products/detail.php の先頭付近に追記
トップページへのリンクと、{$category_name}と、{$arrProduct.name|escape} 以外が表示されない。
表示の概要:「HOME > >(最下層のカテゴリ名) >(商品名)」

以上のように、detail.php に追記する場所によって挙動が変わるような印象を受けています。
もしよろしければ、detail.php のどの辺りに追記して完動させていらっしゃるかご教示いただければ幸いです。
度々となりますがよろしくお願いします。
N-117
投稿日時: 2007/8/14 13:15
対応状況: −−−
新米
登録日: 2007/8/9
居住地:
投稿: 2
Re: パンくずリストの表示
引用:

cotetsuさんは書きました:
たぶん、ほとんどそのまま転記されてるな。。

商品詳細にパンくずリスト

↑↑↑ 参考にさせて頂きました m(__)m

カテゴリ名の表示が出来なかったのと、
リンクが飛ばなかったので、
ちょっとだけ手直ししています。
cotetsu
投稿日時: 2007/8/14 11:59
対応状況: −−−
半人前
登録日: 2007/4/24
居住地:
投稿: 23
Re: パンくずリストの表示
たぶん、ほとんどそのまま転記されてるな。。

商品詳細にパンくずリスト

・浅階層までのカテゴリのパンくずリストです
・僕のところは静的表示してますのでリンクが〜.htmlになってます
・記載漏れがあるかもしれません & 最近、触ってないので忘れました
N-117
投稿日時: 2007/8/14 11:36
対応状況: −−−
新米
登録日: 2007/8/9
居住地:
投稿: 2
Re: パンくずリストの表示
ご参考まで・・・



/products/detail.php


// カテゴリIDを取得する

$objPage->category_id = sfGetCategoryId($tmp_id, "");

$objPage->arrProduct["parent_category_id"] = lfGetParentCategoryID($objPage->arrProduct["category_id"]);
$objPage->arrProduct["root_category_id"] = lfGetRootCategoryID($objPage->arrProduct["category_id"]);

//カテゴリ名を取得する

//$objPage->category_name = GetFirstCat($objPage->category_id);
$conn = new SC_DBConn();
$objPage->category_name = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($objPage->category_id));

$objPage->parent_category_id = lfGetParentCategoryID($objPage->arrProduct["category_id"]);
$objPage->parent_category_name = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($objPage->parent_category_id));

$objPage->root_category_id = lfGetRootCategoryID($objPage->arrProduct["category_id"]);
$objPage->root_category_name = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($objPage->root_category_id));


/* 親カテゴリの取得 */
function lfGetParentCategoryID($category_id) {
$objQuery = new SC_Query();
$parent_category_id = $objQuery->get("dtb_category", "parent_category_id", "category_id = ?", array($category_id));
if($parent_category_id < 1) {
return $category_id;
}
return $parent_category_id;
}

/* ルートカテゴリの取得 */
function lfGetRootCategoryID($category_id) {
$objQuery = new SC_Query();
do{
$parent_category_id = $objQuery->get("dtb_category", "parent_category_id", "category_id = ?", array($category_id));
if($parent_category_id > 0) {
$category_id = $parent_category_id;
}
}while($parent_category_id > 1);
return $category_id;
}



商品詳細ページ


<a href="<!--{$smarty.const.SITE_URL}-->">HOME</a>
<!--{if $arrProduct.root_category_id != $arrProduct.parent_category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.root_category_id}-->"><!--{$root_category_name}--></a>
<!--{/if}-->
<!--{if $arrProduct.parent_category_id != $arrProduct.category_id}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.parent_category_id}-->"><!--{$parent_category_name}--></a>
<!--{/if}-->
> <a href="<!--{$smarty.const.URL_DIR}-->products/list.php?category_id=<!--{$arrProduct.category_id}-->"><!--{$category_name}--></a>
> <!--{$arrProduct.name|escape}-->
ゲスト
投稿日時: 2007/8/12 21:57
対応状況: −−−
Re: パンくずリストの表示
当方もパンくずリスト作成の望んでいる者です。
こちらのフォーラムの過去ログを参考にして試行錯誤したところ、カテゴリ ID の取得はうまくいったのですが、どうしても「カテゴリ名の表示」ができなくて悩んでいます。

/products/detail.php に

$objPage->category_id = sfGetCategoryId($tmp_id, "");
$objPage->category_name = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($objPage->category_id));

を追記してから、商品詳細ページに

<!--{$category_name}-->

を追記すれば、その部分に該当カテゴリ名が表示されるだろうと簡単に考えていたのですが、これではうまくいきませんでした。
どのようにすればカテゴリ名を表示することができるのか、何卒ご教示ください。よろしくお願いします。

なお当方の環境は以下のとおりです。

EC-CUBEバージョン 1.3.4
PHPバージョン PHP 4.3.9
DBバージョン MySQL 4.1.20
« 1 (2) 3 »
スレッド表示 | 古いものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,352名です
総投稿数は110,082件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1652
8
red
1570
9
mcontact
1304
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.