繼昨天把規格1的價錢加到select之後
馬上就碰到第2個問題
原來在ec-ecue中
要放入購物車的價錢是以規格2的select來決定的
所以如果有規格2的參數時
應該是在規格2的select顯示價錢才合理
但是先看到\html\user_data\packages\mystyle\detail.tpl
規格1與規格2的寫法並不相同
所以不是趙昨天的葫蘆畫就ok
不過justfly我研究了一下
發現其時更簡單
先在
\data\class\pages\LC_Page_Products_Detail.php的function lfMakeSelect():
與
\data\class\pages\LC_Page_Products_List.php的function lfMakeSelect():
的// セレクトボックス表示値中加入:”– “.$arrProductsClass[$i][‘price02’].”円'”;
// セレクトボックス表示値 if (!isset($arrList[$list_id])) $arrList[$list_id] = ""; if($arrList[$list_id] == "") { $arrList[$list_id] = "\tlist".$list_id." = new Array('選択してください', '".$arrClassCatName[$classcat_id2]."-- ".$arrProductsClass[$i]['price02']."円'"; } else { $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."-- ".$arrProductsClass[$i]['price02']."円'"; } |
detail.tpl跟list.tpl昨天改的那一行要變成:
detail.tpl:
<!--{if $tpl_classcat_find2}--> <!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}--> <!--{else}--> <!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value price=$arrPriceCat}--> <!--{/if}--> |
list.tpl:
<!--{if $tpl_classcat_find2[$id]}--> <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> <!--{else}--> <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1] price=$arrPriceCat[$id]}--> <!--{/if}--> |
好!收工放飯~~~