バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

プラグイン > バグ報告・利用に関する質問 > 「新着商品プラグイン」の商品ステータス表示について

バグ報告・利用に関する質問

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
bbra
投稿日時: 2015/12/12 18:42
対応状況: −−−
新米
登録日: 2015/12/12
居住地:
投稿: 1
「新着商品プラグイン」の商品ステータス表示について
[EC-CUBE] 2.13.3
[PHP] 5.3.3
[データベース] PostgreSQL 8.4.20

お世話になります。
どうかお力をお貸しください。

現在、下記の「新着商品プラグイン」を利用しております。
http://www.ec-cube.net/products/detail.php?product_id=778

新着順に商品が表示されるプラグインですが、
画像、商品名、値段とは別に商品ステータスも表示させたいと考えています。

http://ec-cube.nakweb.com/blog/1644.html
そこで上記リンク先を参考に自分なりにカスタマイズしてみましたが、
うまく表示されず行き詰っております。

■LC_Page_FrontParts_Bloc_Up_NewProducts.php
( /data/downloads/plugin/Up_NewProducts)

    public function init()
    {
        parent::init();
    }


    public function action()
    {

        //新着商品情報
        $this->arrNewProducts = $this->GetNewProducts();

        //商品レビュー情報を取得
        $this->arrReviewList = $this->getReviewList();

        //商品ステータスを取得
        $this->arrProductStatus = $this->getProductStatus();

        // プラグイン情報を取得
        $this->arrPlugin = $this->getBlocTitle();


    }


    /**
     * 商品ステータスIDの配列を取得する.
     *
     * @return array 商品IDごとのステータス一覧
     */
    public function getProductStatus()
    {
        $objQuery =& SC_Query_Ex::getSingletonInstance();
        $cols = 'product_id, product_status_id';
        $from = 'dtb_product_status';
        $where = 'del_flg = 0';
        $productStatus = $objQuery->select($cols, $from, $where);
        $results = array();
        foreach ($productStatus as $status) {
            $results[$status['product_id']][] = $status['product_status_id'];
        }

        return $productStatus;
    }

↓それぞれ下記のように変更

    public function init()
    {
        parent::init();
        $masterData                 = new SC_DB_MasterData_Ex();
        $this->arrSTATUS            = $masterData->getMasterData('mtb_status');
        $this->arrSTATUS_IMAGE      = $masterData->getMasterData('mtb_status_image');
    }


    public function action()
    {

        //新着商品情報
        $this->arrNewProducts = $this->GetNewProducts();

        //商品レビュー情報を取得
        $this->arrReviewList = $this->getReviewList();

        //商品ステータスを取得
        $this->productStatus = $this->lfGetProductStatus($this->arrBestProducts);

        // プラグイン情報を取得
        $this->arrPlugin = $this->getBlocTitle();


    }


    /**
     * 商品ステータス取得関数
     *
     * @return array $productStatus 商品ステータス配列
     */
    function lfGetProductStatus($arrBestProducts){
        $objQuery =& SC_Query_Ex::getSingletonInstance();
        $col = 'product_status_id';
        $table = 'dtb_product_status';
        $where = 'product_id = ?';
        $arrval = '';
        foreach($arrBestProducts as $val){
            $arrval =  array($val['product_id']);
            $productStatus[$val['product_id']] = $objQuery->getCol($col, $table, $where, $arrval);
        }
        return $productStatus;
    }

■plg_Up_NewProducts.tplに下記を追加
( data/Smarty/templates/default/frontparts/bloc/plg_Up_NewProducts.tpl)

                            <!--商品ステータス-->
                            <!--{assign var=id value=$arrProduct.product_id}-->
                            <!--{if count($productStatus[$id]) > 0}-->
                                <ul class="status_icon clearfix">
                                <!--{foreach from=$productStatus[$id] item=status}-->
                                    <li>
                                        <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" alt="<!--{$arrSTATUS[$status]}-->"/>
                                    </li>
                                <!--{/foreach}-->
                                </ul>
                            <!--{/if}-->

おすすめ商品に関しては上記方法で表示されましたが、
「新着商品プラグイン」では上記方法では表示されず、
相違点を探している最中ではありますが、
依然として解決方法が見出せません。

もしお分かりになる方がいらっしゃいましたら、教えて頂ければ幸いです。
何卒、よろしくお願い致します。
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

総メンバー数は88,953名です
総投稿数は110,019件です

投稿数ランキング

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