既出でしたら申し訳ありません。
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>