EC CUBE 2.11 パンくずリストの出し方 | 柏の葉-KOIL 604-で働く株式会社 Refineの社長ブログBLOG-カフェ店長がWEB業界で起業-~想いが強ければ必ず叶う!~

柏の葉-KOIL 604-で働く株式会社 Refineの社長ブログBLOG-カフェ店長がWEB業界で起業-~想いが強ければ必ず叶う!~

サラリーマン時代、カフェの店長だった僕が2年の間、転職を繰り返して、なぜかWEB業界で起業しました。経営者としての目標達成の心理や、志をこのブログでは書いていきたいと思います。

ECCUBE 2.11では、以前のような「パンくずリスト」のカスタマイズが使用できません

なので、以下のように対応

data/class/pages/products
LC_Page_Products_List.php
LC_Page_Products_Detail.php

この2つのファイルのaction()の最後に

// 商品一覧パンくずリストを取得
$objDb = new SC_Helper_DB_Ex();
if($this->arrForm['category_id']){
$arrCatId = $objDb->sfGetParents("dtb_category", "parent_category_id", "category_id", $this->arrForm['category_id']);
$TopicPath = '<a href="/index.php">' . TopPage . '</a> > ';
foreach($arrCatId as $key => $val){
$arrCatName = $objDb->sfGetCat($val);
if($val != $this->arrForm['category_id']){
$TopicPath .= '<a href="./list.php?category_id=' .$val. '">'. $arrCatName['name'] . '</a> > ';
} else {
$TopicPath .= $arrCatName['name'];
}
}
} else {
$TopicPath = '<a href="/index.php">' . TopPage . '</a> > ' . $this->arrForm['name'] . " の検索結果";
}
$this->TopicPath = $TopicPath;
// パンくずリスト取得終わり

// 商品詳細パンくずリストを取得
        $objDb = new SC_Helper_DB_Ex();
$arrCategory_id = $objDb->sfGetCategoryId($product_id);
$arrCatId = $objDb->sfGetParents("dtb_category", "parent_category_id", "category_id", $arrCategory_id[0]);
$TopicPath = '<a href="/index.php">' . TopPage . '</a> > ';
foreach($arrCatId as $key => $val){
$arrCatName = $objDb->sfGetCat($val);
$TopicPath .= '<a href="./list.php?category_id=' .$val. '">'. $arrCatName['name'] . '</a>';
if($val != $arrCategory_id[0]){
$TopicPath .= ' > ';
}
}
$this->TopicPath = $TopicPath;

// パンくずリスト取得終わり

次にTPLの方に以下を記述
<!--{$TopicPath}-->

これでめでたく実装完了


ふーーーーーーーー

おしまい