バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

質問 > フロント機能 > メーカーごとのナビを表示したい

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
flealog
投稿日時: 2009/6/30 15:14
対応状況: −−−
仙人
登録日: 2008/6/10
居住地:
投稿: 485
Re: メーカーごとのナビを表示したい
引用:


デフォルトで用意されている商品検索ブロックで$arrMakerListをdumpすると表示されたので新規のブロックでも実装できるものと思っておりましたが新規ブロックでdumpしたところNULLでした^^;

そこで調べてみたところ以下のファイルが出力しておりました。

/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts.php

ひとまずこれを複製しLC_Page_FrontParts_Bloc_SearchProducts.php2で保存し表示するtplファイルを変えました。

新規ブロックを作成した際にtplしか作成されていないのですがこれをからませるにはどのような手順になるのでしょうか?


この記事を見て、おぉ・・・ぜひ実装したいと思いやってみました^^
きっかけを与えてもらったので恩返しです。♪

管理ページでmaker.tplを作成。
/html/frontparts/bloc/maker.php
/data/class_extends/page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Maker_Ex.php
を他のファイルからコピーして作成
やり方はここ(フォーラム)で何度も出てます。
わからなかったら調べてください^^

/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Maker.php
を作成


<?php
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

// {{{ requires
require_once(CLASS_PATH . "pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php");

/**
 * メーカー のページクラス.
 *
 * @package Page
 * @author LOCKON CO.,LTD.
 * @version $Id:LC_Page_FrontParts_Bloc_Maker.php 15532 2007-08-31 14:39:46Z nanasess $
 */
class LC_Page_FrontParts_Bloc_Maker extends LC_Page_FrontParts_Bloc {

    // }}}
    // {{{ functions

    /**
     * Page を初期化する.
     *
     * @return void
     */
    function init() {
        parent::init();
        $bloc_file = 'maker.tpl';
        $this->setTplMainpage($bloc_file);
    }

    /**
     * Page のプロセス.
     *
     * @return void
     */
    function process() {
        $objView = new SC_SiteView();
        $objCustomer = new SC_Customer();
        $objQuery = new SC_Query();
        $objDb = new SC_Helper_DB_Ex();

        // メーカーの読込
        $where = "del_flg <> 1";
        $objQuery->setorder("rank DESC");
        $this->arrMaker = $objQuery->select("maker_id, name", "dtb_maker", $where);

        $objView->assignobj($this);

        $objSubView = new SC_SiteView();
        $objSubView->assignobj($this);
        $objSubView->display($this->tpl_mainpage);

    }

    /**
     * デストラクタ.
     *
     * @return void
     */
    function destroy() {
        parent::destroy();
    }
}
?>




DBでdtb_blocにあるmaker.tplのphp_pathをfrontparts/bloc/maker.phpに変更

管理画面ブロック編集でmaker.tplに下記記載

<!--メーカーここから-->
  <ul>
<!--{section name=cnt loop=$arrMaker}-->
      <!--{assign var=maker_id value=$arrMaker[cnt].maker_id}-->
 <li class="maker_list"><a href="<!--{$smarty.const.URL_DIR}-->products/list.php?maker_id=<!--{$arrMaker[cnt].maker_id}-->"><!--{$arrMaker[cnt].name|escape}--></a>
        </li>
<!--{/section}-->
  </ul>
<!--メーカーここまで-->


多分いけると思います^^;
私はこれで表示されました。

ちなみに私はド素人なので、ゴミや間違いがあると思います。
どんどんご指摘して、修正してください。

あと質問にも答えられないことが多いです。
ごめんなさい^^;


----------------
EC-CUBE3っぽいテンプレート
GitHub で公開中
https://github.com/bluestylejp

お問い合わせ番号CSV登録&メール送信プラグイン
http://urx.red/qDT6

フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   メーカーごとのナビを表示したい rst 2009/6/29 23:49
     Re: メーカーごとのナビを表示したい seasoft 2009/6/30 0:10
     Re: メーカーごとのナビを表示したい AMUAMU 2009/6/30 0:52
       Re: メーカーごとのナビを表示したい rst 2009/6/30 13:17
       » Re: メーカーごとのナビを表示したい flealog 2009/6/30 15:14
           Re: メーカーごとのナビを表示したい rst 2009/6/30 16:10
             Re: メーカーごとのナビを表示したい DDR 2009/9/18 15:27

 



ログイン


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

統計情報

総メンバー数は88,856名です
総投稿数は109,989件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1646
8
red
1570
9
mcontact
1291
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.