バージョン選択

フォーラム

メニュー

オンライン状況

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

サイト内検索

 > フロント機能 > 規格で分けられた商品の価格・ポイント表示

フロント機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
ゲスト
投稿日時: 2008/3/27 17:29
対応状況: −−−
規格で分けられた商品の価格・ポイント表示
既出でしたら申し訳ありません。

Ver.2.01で規格で分けられた商品の通常価格・販売価格・ポイントの表示(商品詳細ページ)を

通常価格:●●●〜○○○円
価格(税込):▲▲▲〜△△△円
ポイント:■■■〜□□□円

ではなく

     通常価格   販売価格(税込み) ポイント
規格名1  ●●●円    ▲▲▲円     ■■■Pt 
規格名2  ○○○円    △△△円     □□□Pt

規格別にそれぞれ表示するようにしました。

/data/class/pages/products/LC_Page_Products_Detail.php の変更(青字の部分が変更・追記)


function lfGetProductsClass($product_id) {
        $arrRet = array();
        if(SC_Utils_Ex::sfIsInt($product_id)) {
            // 商品規格取得
            $objQuery = new SC_Query();

            $col = "product_class_id, classcategory_id1,
                    classcategory_id2, class_id1,
                    class_id2, stock,stock_unlimited";
            $table = "vw_product_class AS prdcls";
            $where = "product_id = ?";

            $objQuery->setorder("rank1 DESC, rank2 DESC");
            $arrRet = $objQuery->select($col, $table, 
            $where, array($product_id));
        }
        return $arrRet;
    }


※function lfMakeSelect()の変更(赤字を追加)



  // すべての組み合わせ数
        $count = count($arrProductsClass);

        $classcat_id1 = "";

        $arrSele = array();
        $arrList = array();

        $arrPrice = array();
        $arrName = array();
    $arrPrice2 = array();
    $arrPoint = array();

     $list_id = 0;
        $arrList[0] = "\tlist0 = new Array('選択してください'";




// 規格2のセレクトボックス用
            $classcat_id2 = $arrProductsClass[$i]['classcategory_id2'];

// 規格別の価格と規格名を格納する処理
$arrPrice[$classcat_id1][$classcat_id2] = $arrProductsClass[$i]['price02'] ;
$arrPrice2[$classcat_id1][$classcat_id2] = $arrProductsClass[$i]['price01'] ;
$arrPoint[$classcat_id1][$classcat_id2] = $arrProductsClass[$i]['point_rate'] ;

if ($classcat_id2 == 0 )
   {
   // 規格2が設定されていない場合
   $arrName[$classcat_id1][$classcat_id2] = $arrProductsClass[$i]['name'] ;
   }
else
   {
   $arrName[$classcat_id1][$classcat_id2] = $arrProductsClass[$i]['name']."(".$arrProductsClass[$i]['name2'].")" ;
}

// セレクトボックス表示値



 // 規格1
        $this->arrClassCat1 = $arrSele;

        $this->arrClassPrice = $arrPrice;
        $this->arrClassName = $arrName;
        $this->arrClassPrice2 = $arrPrice2;
        $this->arrClassPoint = $arrPoint;

        $lists = "\tlists = new Array(";
        $no = 0;


/data/Smarty/templates/default/detail.tplの変更。
通常価格・販売価格・ポイントを表示したいところに記述。
デザインは読み替えてください。


<table border=1 width=380>
<tr><td width=120></td>
<td width=80 align="center"><span class="black">
<!--{$smarty.const.NORMAL_PRICE_TITLE}--></span></td>
<td width=110 align="center"><span class="black">
<!--{$smarty.const.SALE_PRICE_TITLE}-->(税込)</span></td>
<td width=70 align="center"><span class="black">ポイント</span></td></tr>
<!--{foreach from=$arrClassPrice key="key" item="datum" name="loop"}-->
<!--{foreach from=$datum key="key2" item="datum2" name="loop"}-->
<tr><td><span class="black"><!--{$arrClassName[$key][$key2]}--></span></td>
<td align="right"><span class="orange">
<!--{$arrClassPrice2[$key][$key2]|number_format}-->円</span></td>
<td align="right"><span class="red">
<!--{$datum2|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->円</span></td>
<td  align="center"><span class="black"><!--{$datum2|sfPrePoint:$arrClassPoint[$key][$key2]:$smarty.const.POINT_RULE:$arrProduct.product_id}-->pt</span></td></tr>
<!--{/foreach}--><!--{/foreach}--></table>
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
 » 規格で分けられた商品の価格・ポイント表示 ゲスト 2008/3/27 17:29

 



ログイン


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

統計情報

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

投稿数ランキング

1
seasoft
7365
2
468
3217
3
AMUAMU
2712
4
nanasess
2303
5
umebius
2085
6
yuh
1818
7
h_tanaka
1610
8
red
1567
9
mcontact
1240
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
796
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.