Changeset 18277
- Timestamp:
- 2009/09/02 18:26:38 (12 years ago)
- Location:
- branches/comu-ver2
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/Smarty/templates/default/detail.tpl
r18254 r18277 21 21 *}--> 22 22 <script type="text/javascript">//<![CDATA[ 23 // セレクトボックスに項目を割り当てる。 24 function lnSetSelect(form, name1, name2, val) { 25 26 sele11 = document[form][name1]; 27 sele12 = document[form][name2]; 28 29 if(sele11 && sele12) { 30 index = sele11.selectedIndex; 31 32 // セレクトボックスのクリア 33 count = sele12.options.length; 34 for(i = count; i >= 0; i--) { 35 sele12.options[i] = null; 36 } 37 38 // セレクトボックスに値を割り当てる 39 len = lists[index].length; 40 for(i = 0; i < len; i++) { 41 sele12.options[i] = new Option(lists[index][i], vals[index][i]); 42 if(val != "" && vals[index][i] == val) { 43 sele12.options[i].selected = true; 23 // 規格2に選択肢を割り当てる。 24 function fnSetClassCategories(form, classcat_id2_selected) { 25 sele1 = form.classcategory_id1; 26 sele2 = form.classcategory_id2; 27 28 if (sele1) { 29 if (sele2) { 30 // 規格2の選択肢をクリア 31 count = sele2.options.length; 32 for(i = count; i >= 0; i--) { 33 sele2.options[i] = null; 34 } 35 36 // 規格2に選択肢を割り当てる 37 classcats = classCategories[sele1.value]; 38 i = 0; 39 for (var classcat_id2_key in classcats) { 40 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcat_id2_key); 41 if (classcat_id2_key == classcat_id2_selected) { 42 sele2.options[i].selected = true; 43 } 44 i++; 44 45 } 45 46 } 47 fnCheckStock(form); 48 } 49 } 50 function fnCheckStock(form) { 51 classcat_id1 = form.classcategory_id1.value; 52 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : 0; 53 classcat2 = classCategories[classcat_id1][classcat_id2]; 54 55 // 在庫(品切れ) 56 eleDefault = document.getElementById('cartbtn_default'); 57 eleDynamic = document.getElementById('cartbtn_dynamic'); 58 if ( 59 classcat2 60 && classcat2.stock_find === false 61 ) { 62 eleDefault.style.display = 'none'; 63 eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。'; 64 } else { 65 eleDefault.style.display = ''; 66 eleDynamic.innerHTML = ''; 67 } 68 69 // 通常価格 70 eleDefault = document.getElementById('price01_default'); 71 eleDynamic = document.getElementById('price01_dynamic'); 72 if ( 73 classcat2 74 && typeof classcat2.price01 != 'undefined' 75 && String(classcat2.price01).length >= 1 76 ) { 77 eleDefault.style.display = 'none'; 78 eleDynamic.innerHTML = classcat2.price01; 79 } else { 80 eleDefault.style.display = ''; 81 eleDynamic.innerHTML = ''; 82 } 83 84 // 販売価格 85 eleDefault = document.getElementById('price02_default'); 86 eleDynamic = document.getElementById('price02_dynamic'); 87 if ( 88 classcat2 89 && typeof classcat2.price02 != 'undefined' 90 && String(classcat2.price02).length >= 1 91 ) { 92 eleDefault.style.display = 'none'; 93 eleDynamic.innerHTML = classcat2.price02; 94 } else { 95 eleDefault.style.display = ''; 96 eleDynamic.innerHTML = ''; 97 } 98 99 // ポイント 100 eleDefault = document.getElementById('point_default'); 101 eleDynamic = document.getElementById('point_dynamic'); 102 if ( 103 classcat2 104 && typeof classcat2.point != 'undefined' 105 && String(classcat2.point).length >= 1 106 ) { 107 eleDefault.style.display = 'none'; 108 eleDynamic.innerHTML = classcat2.point; 109 } else { 110 eleDefault.style.display = ''; 111 eleDynamic.innerHTML = ''; 46 112 } 47 113 } … … 77 143 78 144 <div id="detailrightblock"> 79 <!-- アイコン-->145 <!--▼商品ステータス--> 80 146 <!--{if count($arrProduct.product_flag) > 0}--> 81 147 <ul class="status_icon"> … … 90 156 </ul> 91 157 <!--{/if}--> 158 <!--▲商品ステータス--> 92 159 93 160 <!--★商品コード★--> … … 108 175 <div class="sale_price"><!--{$smarty.const.SALE_PRICE_TITLE}--><span class="mini">(税込)</span>: 109 176 <span class="price"> 110 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 111 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 112 <!--{else}--> 113 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 114 <!--{/if}-->円</span></div> 177 <span id="price02_default"> 178 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 179 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 180 <!--{else}--> 181 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 182 <!--{/if}--> 183 </span><span id="price02_dynamic"></span> 184 円 185 </span> 186 </div> 115 187 116 188 <!--★通常価格★--> … … 119 191 <!--{$smarty.const.NORMAL_PRICE_TITLE}-->: 120 192 <span class="price"> 121 <!--{if $arrProduct.price01_min == $arrProduct.price01_max}--> 122 <!--{$arrProduct.price01_min|number_format}--> 123 <!--{else}--> 124 <!--{$arrProduct.price01_min|number_format}-->~<!--{$arrProduct.price01_max|number_format}--> 125 <!--{/if}-->円</span> 193 <span id="price01_default"> 194 <!--{if $arrProduct.price01_min == $arrProduct.price01_max}--> 195 <!--{$arrProduct.price01_min|number_format}--> 196 <!--{else}--> 197 <!--{$arrProduct.price01_min|number_format}-->~<!--{$arrProduct.price01_max|number_format}--> 198 <!--{/if}--> 199 </span><span id="price01_dynamic"></span> 200 円 201 </span> 126 202 </div> 127 203 <!--{/if}--> … … 130 206 <!--{if $smarty.const.USE_POINT !== false}--> 131 207 <div><span class="price">ポイント: 132 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 133 <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 134 <!--{else}--> 135 <!--{if $arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id == $arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 208 <span id="point_default"> 209 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 136 210 <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 137 211 <!--{else}--> 138 <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->~<!--{$arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 139 <!--{/if}--> 140 <!--{/if}-->Pt</span></div> 212 <!--{if $arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id == $arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 213 <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 214 <!--{else}--> 215 <!--{$arrProduct.price02_min|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}-->~<!--{$arrProduct.price02_max|sfPrePoint:$arrProduct.point_rate:$smarty.const.POINT_RULE:$arrProduct.product_id}--> 216 <!--{/if}--> 217 <!--{/if}--> 218 </span><span id="point_dynamic"></span> 219 Pt 220 </span> 221 </div> 141 222 <!--{/if}--> 142 223 … … 153 234 </div> 154 235 155 156 <form name="form1" id="form1" method="post" action=" <!--{$smarty.server.REQUEST_URI|escape}-->">236 <!--▼買い物かご--> 237 <form name="form1" id="form1" method="post" action="?"> 157 238 <input type="hidden" name="mode" value="cart" /> 158 239 <input type="hidden" name="product_id" value="<!--{$tpl_product_id}-->" /> 159 240 <input type="hidden" name="favorite_product_id" value="" /> 160 <!--{if $tpl_classcat_find1}--> 161 <dl> 162 <dt> 163 <!--{$tpl_class_name1}--> 164 </dt> 165 <dd> 166 <select name="classcategory_id1" 167 style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->" 168 onchange="lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', ''); " 169 > 170 <option value="">選択してください</option> 171 <!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}--> 172 </select> 173 <!--{if $arrErr.classcategory_id1 != ""}--> 174 <br /><span class="attention">※ <!--{$tpl_class_name1}-->を入力して下さい。</span> 175 <!--{/if}--> 176 </dd> 177 </dl> 241 242 <!--{if $tpl_stock_find}--> 243 <dl> 244 <!--{if $tpl_classcat_find1}--> 245 <!--▼規格1--> 246 <dt><!--{$tpl_class_name1|escape}--></dt> 247 <dd> 248 <select name="classcategory_id1" 249 style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->" 250 onchange="fnSetClassCategories(this.form);" 251 > 252 <!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}--> 253 </select> 254 <!--{if $arrErr.classcategory_id1 != ""}--> 255 <br /><span class="attention">※ <!--{$tpl_class_name1}-->を入力して下さい。</span> 256 <!--{/if}--> 257 </dd> 258 <!--▲規格1--> 259 <!--{/if}--> 260 261 <!--{if $tpl_classcat_find2}--> 262 <!--▼規格2--> 263 <dt><!--{$tpl_class_name2|escape}--></dt> 264 <dd> 265 <select name="classcategory_id2" 266 style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->" 267 onchange="fnCheckStock(this.form);" 268 > 269 </select> 270 <!--{if $arrErr.classcategory_id2 != ""}--> 271 <br /><span class="attention">※ <!--{$tpl_class_name2}-->を入力して下さい。</span> 272 <!--{/if}--> 273 </dd> 274 <!--▲規格2--> 275 <!--{/if}--> 276 277 <dt>数量</dt> 278 <dd> 279 <input type="text" name="quantity" class="box54" value="<!--{$arrForm.quantity.value|default:1}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" /> 280 <!--{if $arrErr.quantity != ""}--> 281 <br /><span class="attention"><!--{$arrErr.quantity}--></span> 282 <!--{/if}--> 283 </dd> 284 </dl> 178 285 <!--{/if}--> 179 180 <!--{if $tpl_stock_find}--> 181 <!--{if $tpl_classcat_find2}--> 182 <dl> 183 <dt><!--{$tpl_class_name2}--></dt> 184 <dd> 185 <select name="classcategory_id2" 186 style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->"> 187 <option value="">選択してください</option> 188 </select> 189 <!--{if $arrErr.classcategory_id2 != ""}--> 190 <br /><span class="attention">※ <!--{$tpl_class_name2}-->を入力して下さい。</span> 191 <!--{/if}--> 192 </dd> 193 </dl> 194 <!--{/if}--> 195 196 <dl> 197 <dt>数量</dt> 198 <dd><input type="text" name="quantity" class="box54" value="<!--{$arrForm.quantity.value|default:1}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" /> 199 <!--{if $arrErr.quantity != ""}--> 200 <br /><span class="attention"><!--{$arrErr.quantity}--></span> 201 <!--{/if}--> 202 </dd> 203 </dl> 204 <!--{/if}--> 205 206 <!--{if $tpl_stock_find}--> 207 <p class="btn"> 208 <!--{if $smarty.const.OPTION_FAVOFITE_PRODUCT == 1 && $tpl_login === true}--> 286 287 <div class="btn"> 288 <!--{if $smarty.const.OPTION_FAVOFITE_PRODUCT == 1 && $tpl_login === true}--> 289 <div> 209 290 <!--{assign var=add_favorite value="add_favorite`$product_id`"}--> 210 291 <!--{if $arrErr[$add_favorite]}--><div class="attention"><!--{$arrErr[$add_favorite]}--></div><!--{/if}--> … … 218 299 <img src="<!--{$TPL_DIR}-->img/products/add_favolite_product_on.gif" width="115" height="20" alt="お気に入り登録済" name="add_favolite_product" id="add_favolite_product" /> 219 300 <!--{/if}--> 220 <!--{/if}--> 221 <!--★カゴに入れる★--> 222 <a href="javascript:void(document.form1.submit())" onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin_on.gif','cart');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin.gif','cart');"> 223 <img src="<!--{$TPL_DIR}-->img/products/b_cartin.gif" width="115" height="25" alt="カゴに入れる" name="cart" id="cart" /></a> 224 </p> 225 <!--{if 'sfGMODetailDisplay'|function_exists}--><!--{* GMOワンクリック *}--> 226 <!--{'sfGMODetailDisplay'|call_user_func}--> 301 </div> 227 302 <!--{/if}--> 228 <!--{else}--> 229 <div class="attention">申し訳ございませんが、只今品切れ中です。</div> 230 <!--{/if}--> 303 304 <!--{if $tpl_stock_find}--> 305 <div id="cartbtn_default"> 306 <!--★カゴに入れる★--> 307 <div> 308 <a href="javascript:void(document.form1.submit())" onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin_on.gif','cart');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin.gif','cart');"> 309 <img src="<!--{$TPL_DIR}-->img/products/b_cartin.gif" width="115" height="25" alt="カゴに入れる" name="cart" id="cart" /></a> 310 </div> 311 <!--{if 'sfGMODetailDisplay'|function_exists}--><!--{* GMOワンクリック *}--> 312 <!--{'sfGMODetailDisplay'|call_user_func}--> 313 <!--{/if}--> 314 </div> 315 <div class="attention" id="cartbtn_dynamic"></div> 316 <!--{else}--> 317 <div class="attention">申し訳ございませんが、只今品切れ中です。</div> 318 <!--{/if}--> 319 </div> 231 320 </form> 321 <!--▲買い物かご--> 232 322 233 323 </div> … … 255 345 <div class="subphotoimg"> 256 346 <a 257 347 <!--{if $arrFile[$lkey].filepath != ""}--> 258 348 href="?" 259 349 onclick="win01('./detail_image.php?product_id=<!--{$arrProduct.product_id}-->&image=<!--{$lkey}--><!--{if $smarty.get.admin == 'on'}-->&admin=on<!--{/if}-->','detail_image','<!--{$arrFile[$lkey].width+60}-->','<!--{$arrFile[$lkey].height+80}-->'); return false;" 260 350 target="_blank" 261 351 <!--{/if}--> 262 352 > 263 353 <!--サブ画像--> 264 354 <img src="<!--{$arrFile[$key].filepath}-->" alt="<!--{$arrProduct.name|escape}-->" width="<!--{$smarty.const.NORMAL_SUBIMAGE_WIDTH}-->" height="<!--{$smarty.const.NORMAL_SUBIMAGE_HEIGHT}-->" /></a> 265 355 <!--{if $arrFile[$lkey].filepath != ""}--> -
branches/comu-ver2/data/Smarty/templates/default/list.tpl
r18260 r18277 21 21 *}--> 22 22 <script type="text/javascript">//<![CDATA[ 23 // セレクトボックスに項目を割り当てる。24 function fnSet Select(form, val) {25 sele1 = form ['classcategory_id1'];26 sele2 = form ['classcategory_id2'];27 id = form['product_id'].value;28 lists = eval('lists' + id); 29 vals = eval('vals' + id);30 31 if(sele1 && sele2) {32 index = sele1.selectedIndex;33 34 // セレクトボックスのクリア35 count = sele2.options.length;36 for(i = count; i >= 0; i--) {37 sele2.options[i] = null;38 }39 40 // セレクトボックスに値を割り当てる41 len = lists[index].length;42 for(i = 0; i < len; i++) {43 sele2.options[i] = new Option(lists[index][i], vals[index][i]);44 if(val != "" && vals[index][i] == val) {45 sele2.options[i].selected = true;23 // 規格2に選択肢を割り当てる。 24 function fnSetClassCategories(form, classcat_id2_selected) { 25 sele1 = form.classcategory_id1; 26 sele2 = form.classcategory_id2; 27 product_id = form.product_id.value; 28 29 if (sele1) { 30 if (sele2) { 31 // 規格2の選択肢をクリア 32 count = sele2.options.length; 33 for(i = count; i >= 0; i--) { 34 sele2.options[i] = null; 35 } 36 37 // 規格2に選択肢を割り当てる 38 classcats = productsClassCategories[product_id][sele1.value]; 39 i = 0; 40 for (var classcat_id2_key in classcats) { 41 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcat_id2_key); 42 if (classcat_id2_key == classcat_id2_selected) { 43 sele2.options[i].selected = true; 44 } 45 i++; 46 46 } 47 47 } 48 fnCheckStock(form); 48 49 } 49 50 } … … 73 74 fnSetVal("product_id", productForm["product_id"].value); 74 75 fnSubmit(); 76 } 77 function fnCheckStock(form) { 78 product_id = form.product_id.value; 79 classcat_id1 = form.classcategory_id1.value; 80 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : 0; 81 classcat2 = productsClassCategories[product_id][classcat_id1][classcat_id2]; 82 83 // 在庫(品切れ) 84 eleDefault = document.getElementById('cartbtn_default_' + product_id); 85 eleDynamic = document.getElementById('cartbtn_dynamic_' + product_id); 86 if ( 87 classcat2 88 && classcat2.stock_find === false 89 ) { 90 eleDefault.style.display = 'none'; 91 eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。'; 92 } else { 93 eleDefault.style.display = ''; 94 eleDynamic.innerHTML = ''; 95 } 96 97 // 販売価格 98 eleDefault = document.getElementById('price02_default_' + product_id); 99 eleDynamic = document.getElementById('price02_dynamic_' + product_id); 100 if ( 101 classcat2 102 && typeof classcat2.price02 != 'undefined' 103 && String(classcat2.price02).length >= 1 104 ) { 105 eleDefault.style.display = 'none'; 106 eleDynamic.innerHTML = classcat2.price02; 107 } else { 108 eleDefault.style.display = ''; 109 eleDynamic.innerHTML = ''; 110 } 75 111 } 76 112 //]]> … … 107 143 <ul class="pagecondarea"> 108 144 <li><strong>商品カテゴリ:</strong><!--{$arrSearch.category|escape}--></li> 109 145 <!--{if $arrSearch.maker|strlen >= 1}--><li><strong>メーカー:</strong><!--{$arrSearch.maker|escape}--></li><!--{/if}--> 110 146 <li><strong>商品名:</strong><!--{$arrSearch.name|escape}--></li> 111 147 </ul> … … 126 162 <!--{/if}--> 127 163 <!--{if $orderby != "date"}--> 128 <a href="javascript:fnChangeOrderby('date');">新着順</a>164 <a href="javascript:fnChangeOrderby('date');">新着順</a> 129 165 <!--{else}--> 130 166 <strong>新着順</strong> … … 134 170 <!--{foreach from=$arrPRODUCTLISTMAX item="dispnum" key="num"}--> 135 171 <!--{if $num == $disp_number}--> 136 172 <option value="<!--{$num}-->" selected="selected" ><!--{$dispnum}--></option> 137 173 <!--{else}--> 138 174 <option value="<!--{$num}-->" ><!--{$dispnum}--></option> 139 175 <!--{/if}--> 140 176 <!--{/foreach}--> … … 150 186 <!--{foreach from=$arrProducts item=arrProduct}--> 151 187 <!--{assign var=id value=$arrProduct.product_id}--> 188 <!--{assign var=arrErr value=$arrProduct.arrErr}--> 152 189 <!--▼商品--> 153 190 <div class="listarea"> 154 191 <a name="product<!--{$id|escape}-->" /> 155 192 <div class="listphoto"> 156 193 <!--★画像★--> 157 194 <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProduct.product_id}-->" class="over"><!--商品写真--><img src="<!--{$smarty.const.IMAGE_SAVE_URL|sfTrimURL}-->/<!--{$arrProduct.main_list_image|sfNoImageMainList|escape}-->" alt="<!--{$arrProduct.name|escape}-->" class="picture" /></a> 158 195 </div> 159 196 160 197 <div class="listrightblock"> 161 <!--アイコン--> 162 <!--商品ステータス--> 198 <!--▼商品ステータス--> 163 199 <!--{if count($arrProduct.product_flag) > 0}--> 164 200 <ul class="status_icon"> 165 201 <!--{section name=flg loop=$arrProduct.product_flag|count_characters}--> 166 202 <!--{if $arrProduct.product_flag[flg] == "1"}--> 167 <!--{assign var=key value="`$smarty.section.flg.iteration`"}--> 168 <li><img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$key]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$key]}-->"/></li> 169 <!--{assign var=sts_cnt value=$sts_cnt+1}--> 203 <li> 204 <!--{assign var=key value="`$smarty.section.flg.iteration`"}--> 205 <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$key]}-->" width="65" height="17" alt="<!--{$arrSTATUS[$key]}-->"/> 206 </li> 170 207 <!--{/if}--> 171 208 <!--{/section}--> 172 209 </ul> 173 210 <!--{/if}--> 174 <!--商品ステータス--> 175 <!--アイコン--> 211 <!--▲商品ステータス--> 176 212 177 213 <!--★商品名★--> 178 214 <h3> 179 <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProduct.product_id}-->" ><!--{$arrProduct.name|escape}--></a>215 <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProduct.product_id}-->" name="product<!--{$arrProduct.product_id}-->"><!--{$arrProduct.name|escape}--></a> 180 216 </h3> 181 217 … … 187 223 <!--{$smarty.const.SALE_PRICE_TITLE}--><span class="mini">(税込)</span>: 188 224 <span class="price"> 189 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 190 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 191 <!--{else}--> 192 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 193 <!--{/if}-->円</span> 225 <span id="price02_default_<!--{$id}-->"> 226 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 227 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 228 <!--{else}--> 229 <!--{$arrProduct.price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 230 <!--{/if}--> 231 </span><span id="price02_dynamic_<!--{$id}-->"></span> 232 円</span> 194 233 </span> 195 234 196 235 <!--★詳細ボタン★--> 197 236 <span class="btnbox"> 198 199 200 237 <!--{assign var=name value="detail`$id`"}--> 238 <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProduct.product_id}-->" onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_detail_on.gif','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_detail.gif','<!--{$name}-->');"> 239 <img src="<!--{$TPL_DIR}-->img/products/b_detail.gif" width="115" height="25" alt="詳しくはこちら" name="<!--{$name}-->" id="<!--{$name}-->" /></a> 201 240 </span> 202 241 </p> 203 242 204 <!--{if $arrProduct.stock_max == 0 && $arrProduct.stock_unlimited_max != 1}--> 205 <p class="soldout"><em>申し訳ございませんが、只今品切れ中です。</em></p> 206 <!--{else}--> 207 <!--▼買い物かご--> 208 <form name="product_form<!--{$id|escape}-->" action="?"> 209 <input type="hidden" name="product_id" value="<!--{$id|escape}-->" /> 210 <div class="in_cart"> 243 <!--▼買い物かご--> 244 <form name="product_form<!--{$id|escape}-->" action="?" onsubmit="return false;"> 245 <input type="hidden" name="product_id" value="<!--{$id|escape}-->" /> 246 <div class="in_cart"> 247 <!--{if $tpl_stock_find[$id]}--> 211 248 <dl> 212 249 <!--{if $tpl_classcat_find1[$id]}--> 250 <!--▼規格1--> 213 251 <dt><!--{$tpl_class_name1[$id]|escape}-->:</dt> 214 252 <dd> 215 <select name="classcategory_id1" style="<!--{$arrProduct.arrErr.classcategory_id1|sfGetErrorColor}-->" onchange="fnSetSelect(this.form);"> 216 <option value="">選択してください</option> 217 <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}--> 253 <select name="classcategory_id1" 254 style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->" 255 onchange="fnSetClassCategories(this.form);" 256 > 257 <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}--> 218 258 </select> 219 <!--{if $arr Product.arrErr.classcategory_id1 != ""}-->259 <!--{if $arrErr.classcategory_id1 != ""}--> 220 260 <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span> 221 261 <!--{/if}--> 222 262 </dd> 263 <!--▲規格1--> 223 264 <!--{/if}--> 224 265 <!--{if $tpl_classcat_find2[$id]}--> 266 <!--▼規格2--> 225 267 <dt><!--{$tpl_class_name2[$id]|escape}-->:</dt> 226 268 <dd> 227 <select name="classcategory_id2" style="<!--{$arrProduct.arrErr.classcategory_id2|sfGetErrorColor}-->"> 228 <option value="">選択してください</option> 269 <select name="classcategory_id2" 270 style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->" 271 onchange="fnCheckStock(this.form);" 272 > 229 273 </select> 230 <!--{if $arr Product.arrErr.classcategory_id2 != ""}-->274 <!--{if $arrErr.classcategory_id2 != ""}--> 231 275 <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span> 232 276 <!--{/if}--> 233 277 </dd> 278 <!--▲規格2--> 234 279 <!--{/if}--> 235 280 236 281 <dt>数量:</dt> 237 282 <dd> 238 <input type="text" name="quantity" size="3" class="box54" value="<!--{$arrProduct.quantity|default:1|escape}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrProduct.arrErr.quantity|sfGetErrorColor}-->" />239 <!--{if $arr Product.arrErr.quantity != ""}-->240 <br /><span class="attention"><!--{$arr Product.arrErr.quantity}--></span>283 <input type="text" name="quantity" class="box54" value="<!--{$arrProduct.quantity|default:1|escape}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" /> 284 <!--{if $arrErr.quantity != ""}--> 285 <br /><span class="attention"><!--{$arrErr.quantity}--></span> 241 286 <!--{/if}--> 242 287 </dd> 243 288 </dl> 244 289 <div class="cartbtn"> 245 <input 246 type="image" 247 id="cart<!--{$id}-->" 248 src="<!--{$TPL_DIR}-->img/products/b_cartin.gif" 249 alt="カゴに入れる" 250 onclick="fnInCart(this.form); return false;" 251 onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin_on.gif', this);" 252 onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin.gif', this);" 253 /> 290 <!--★カゴに入れる★--> 291 <div id="cartbtn_default_<!--{$id}-->"> 292 <input 293 type="image" 294 id="cart<!--{$id}-->" 295 src="<!--{$TPL_DIR}-->img/products/b_cartin.gif" 296 alt="カゴに入れる" 297 onclick="fnInCart(this.form); return false;" 298 onmouseover="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin_on.gif', this);" 299 onmouseout="chgImg('<!--{$TPL_DIR}-->img/products/b_cartin.gif', this);" 300 /> 301 </div> 302 <div class="attention" id="cartbtn_dynamic_<!--{$id}-->"></div> 254 303 </div> 255 </div> 256 </form> 257 <!--▲買い物かご--> 258 <!--{/if}--> 304 <!--{else}--> 305 <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div> 306 <!--{/if}--> 307 </div> 308 </form> 309 <!--▲買い物かご--> 259 310 260 311 </div> … … 282 333 表示件数 283 334 <select name="disp_number" onchange="javascript:fnChangeDispNumber(this.value);"> 284 285 286 287 288 289 290 335 <!--{foreach from=$arrPRODUCTLISTMAX item="dispnum" key="num"}--> 336 <!--{if $num == $disp_number}--> 337 <option value="<!--{$num}-->" selected="selected" ><!--{$dispnum}--></option> 338 <!--{else}--> 339 <option value="<!--{$num}-->" ><!--{$dispnum}--></option> 340 <!--{/if}--> 341 <!--{/foreach}--> 291 342 </select> 292 343 </li> -
branches/comu-ver2/data/class/pages/products/LC_Page_Products_Detail.php
r18275 r18277 151 151 $this->lfMakeSelect($product_id); 152 152 153 require_once CLASS_PATH . 'SC_Product.php'; 154 $objProduct = new SC_Product($product_id); 155 // 規格1クラス名 156 $this->tpl_class_name1 = $objProduct->className1[$product_id]; 157 158 // 規格2クラス名 159 $this->tpl_class_name2 = $objProduct->className2[$product_id]; 160 161 // 規格1 162 $this->arrClassCat1 = $objProduct->classCats1[$product_id]; 163 164 // 規格1が設定されている 165 $this->tpl_classcat_find1 = $objProduct->classCat1_find[$product_id]; 166 // 規格2が設定されている 167 $this->tpl_classcat_find2 = $objProduct->classCat2_find[$product_id]; 168 169 $this->tpl_stock_find = $objProduct->stock_find[$product_id]; 170 171 require_once DATA_PATH . 'module/Services/JSON.php'; 172 $objJson = new Services_JSON(); 173 $this->tpl_javascript .= 'classCategories = ' . $objJson->encode($objProduct->classCategories[$product_id]) . ';'; 174 $this->tpl_javascript .= 'function lnOnLoad(){' . $this->js_lnOnload . '}'; 175 $this->tpl_onload .= 'lnOnLoad();'; 176 153 177 // 商品IDをFORM内に保持する。 154 178 $this->tpl_product_id = $product_id; 155 179 156 180 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 157 181 $arrErr = array(); 182 158 183 switch($_POST['mode']) { 159 case 'cart': 160 // 入力値の変換 161 $this->objFormParam->convParam(); 162 $this->arrErr = $this->lfCheckError(); 163 if(count($this->arrErr) == 0) { 164 $objCartSess = new SC_CartSession(); 165 $classcategory_id1 = $_POST['classcategory_id1']; 166 $classcategory_id2 = $_POST['classcategory_id2']; 167 168 if (!empty($_POST['gmo_oneclick'])) { 169 $objCartSess->delAllProducts(); 170 } 171 172 // 規格1が設定されていない場合 173 if(!$this->tpl_classcat_find1) { 174 $classcategory_id1 = '0'; 175 } 176 177 // 規格2が設定されていない場合 178 if(!$this->tpl_classcat_find2) { 179 $classcategory_id2 = '0'; 180 } 181 182 $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); 183 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 184 185 if (!empty($_POST['gmo_oneclick'])) { 186 $objSiteSess = new SC_SiteSession; 187 $objSiteSess->setRegistFlag(); 188 $objCartSess->saveCurrentCart($objSiteSess->getUniqId()); 189 190 $this->sendRedirect($this->getLocation( 191 URL_DIR . 'user_data/gmopg_oneclick_confirm.php', array(), true)); 184 case 'cart': 185 // 入力値の変換 186 $this->objFormParam->convParam(); 187 $arrErr = $this->lfCheckError(); 188 if (count($arrErr) == 0) { 189 $objCartSess = new SC_CartSession(); 190 $classcategory_id1 = $_POST['classcategory_id1']; 191 $classcategory_id2 = $_POST['classcategory_id2']; 192 193 if (!empty($_POST['gmo_oneclick'])) { 194 $objCartSess->delAllProducts(); 195 } 196 197 // 規格1が設定されていない場合 198 if(!$this->tpl_classcat_find1) { 199 $classcategory_id1 = '0'; 200 } 201 202 // 規格2が設定されていない場合 203 if(!$this->tpl_classcat_find2) { 204 $classcategory_id2 = '0'; 205 } 206 207 $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); 208 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 209 210 if (!empty($_POST['gmo_oneclick'])) { 211 $objSiteSess = new SC_SiteSession; 212 $objSiteSess->setRegistFlag(); 213 $objCartSess->saveCurrentCart($objSiteSess->getUniqId()); 214 215 $this->sendRedirect($this->getLocation( 216 URL_DIR . 'user_data/gmopg_oneclick_confirm.php', array(), true)); 217 exit; 218 } 219 220 $this->sendRedirect($this->getLocation(URL_CART_TOP)); 192 221 exit; 193 222 } 194 195 $this->sendRedirect($this->getLocation(URL_CART_TOP)); 196 exit; 197 } 198 break; 199 200 default: 201 break; 202 } 203 204 $objQuery = new SC_Query(); 223 break; 224 225 default: 226 break; 227 } 228 $this->arrErr = $arrErr; 229 205 230 // DBから商品情報を取得する。 206 231 $arrRet = $objQuery->select("*, (SELECT count(*) FROM dtb_customer_favorite_products WHERE product_id = alldtl.product_id AND customer_id = ?) AS favorite_count", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($objCustomer->getValue('customer_id'), $product_id)); … … 510 535 511 536 /* 規格選択セレクトボックスの作成 */ 512 function lfMakeSelect($product_id) { 513 514 $objDb = new SC_Helper_DB_Ex(); 515 $classcat_find1 = false; 516 $classcat_find2 = false; 517 // 在庫ありの商品の有無 518 $stock_find = false; 519 520 // 規格名一覧 521 $arrClassName = $objDb->sfGetIDValueList("dtb_class", "class_id", "name"); 522 // 規格分類名一覧 523 $arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 524 // 商品規格情報の取得 525 $arrProductsClass = $this->lfGetProductsClass($product_id); 526 527 // 規格1クラス名の取得 528 $this->tpl_class_name1 = isset($arrClassName[$arrProductsClass[0]['class_id1']]) 529 ? $arrClassName[$arrProductsClass[0]['class_id1']] : ""; 530 // 規格2クラス名の取得 531 $this->tpl_class_name2 = isset($arrClassName[$arrProductsClass[0]['class_id2']]) 532 ? $arrClassName[$arrProductsClass[0]['class_id2']] : ""; 533 534 // すべての組み合わせ数 535 $count = count($arrProductsClass); 536 537 $classcat_id1 = ""; 538 539 $arrSele = array(); 540 $arrList = array(); 541 542 $list_id = 0; 543 $arrList[0] = "\tlist0 = new Array('選択してください'"; 544 $arrVal[0] = "\tval0 = new Array(''"; 545 546 for ($i = 0; $i < $count; $i++) { 547 // 在庫のチェック 548 if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 549 continue; 550 } 551 552 $stock_find = true; 553 554 // 規格1のセレクトボックス用 555 if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ 556 $arrList[$list_id].=");\n"; 557 $arrVal[$list_id].=");\n"; 558 $classcat_id1 = $arrProductsClass[$i]['classcategory_id1']; 559 $arrSele[$classcat_id1] = $arrClassCatName[$classcat_id1]; 560 $list_id++; 561 } 562 563 // 規格2のセレクトボックス用 564 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 565 566 // セレクトボックス表示値 567 if (!isset($arrList[$list_id])) $arrList[$list_id] = ""; 568 if($arrList[$list_id] == "") { 569 $arrList[$list_id] = "\tlist".$list_id." = new Array('選択してください', '".$arrClassCatName[$classcat_id2]."'"; 570 } else { 571 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 572 } 573 574 // セレクトボックスPOST値 575 if (!isset($arrVal[$list_id])) $arrVal[$list_id] = ""; 576 if($arrVal[$list_id] == "") { 577 $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'"; 578 } else { 579 $arrVal[$list_id].= ", '".$classcat_id2."'"; 580 } 581 } 582 583 $arrList[$list_id].=");\n"; 584 $arrVal[$list_id].=");\n"; 585 586 // 規格1 587 $this->arrClassCat1 = $arrSele; 588 589 $lists = "\tlists = new Array("; 590 $no = 0; 591 592 foreach($arrList as $val) { 593 $this->tpl_javascript.= $val; 594 if ($no != 0) { 595 $lists.= ",list".$no; 596 } else { 597 $lists.= "list".$no; 598 } 599 $no++; 600 } 601 $this->tpl_javascript.=$lists.");\n"; 602 603 $vals = "\tvals = new Array("; 604 $no = 0; 605 606 foreach($arrVal as $val) { 607 $this->tpl_javascript.= $val; 608 if ($no != 0) { 609 $vals.= ",val".$no; 610 } else { 611 $vals.= "val".$no; 612 } 613 $no++; 614 } 615 $this->tpl_javascript.=$vals.");\n"; 616 617 // 選択されている規格2ID 618 if (!isset($_POST['classcategory_id2'])) $_POST['classcategory_id2'] = ""; 619 $this->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . htmlspecialchars($_POST['classcategory_id2'], ENT_QUOTES) . "');"; 620 621 // 規格1が設定されている 622 if($arrProductsClass[0]['classcategory_id1'] != '0') { 623 $classcat_find1 = true; 624 } 625 626 // 規格2が設定されている 627 if($arrProductsClass[0]['classcategory_id2'] != '0') { 628 $classcat_find2 = true; 629 } 630 631 $this->tpl_classcat_find1 = $classcat_find1; 632 $this->tpl_classcat_find2 = $classcat_find2; 633 $this->tpl_stock_find = $stock_find; 537 function lfMakeSelect() { 538 539 // 選択されている規格 540 $classcategory_id1 541 = isset($_POST['classcategory_id1']) && is_numeric($_POST['classcategory_id1']) 542 ? $_POST['classcategory_id1'] 543 : ''; 544 545 $classcategory_id2 546 = isset($_POST['classcategory_id2']) && is_numeric($_POST['classcategory_id2']) 547 ? $_POST['classcategory_id2'] 548 : ''; 549 550 require_once DATA_PATH . 'module/Services/JSON.php'; 551 $this->js_lnOnload .= 'fnSetClassCategories(' 552 . 'document.form1, ' 553 . Services_JSON::encode($classcategory_id2) 554 . '); '; 634 555 } 635 556 -
branches/comu-ver2/data/class/pages/products/LC_Page_Products_List.php
r18275 r18277 103 103 $count = $objQuery->count("dtb_best_products", "category_id = ?", array($this->arrSearchData['category_id'])); 104 104 105 // 商品一覧の表示処理105 // 商品一覧の表示処理 106 106 $this->lfDispProductsList(); 107 107 108 // 検索条件を画面に表示109 // カテゴリー検索条件108 // 検索条件を画面に表示 109 // カテゴリー検索条件 110 110 if ($this->arrSearchData['category_id'] == 0) { 111 111 $this->arrSearch['category'] = "指定なし"; … … 113 113 $arrCat = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?", array($this->arrSearchData['category_id'])); 114 114 $this->arrSearch['category'] = $arrCat; 115 }116 117 // メーカー検索条件115 } 116 117 // メーカー検索条件 118 118 if (strlen($this->arrSearchData['maker_id']) == 0) { 119 119 $this->arrSearch['maker'] = "指定なし"; 120 120 } else { 121 121 $this->arrSearch['maker'] = $name = $conn->getOne("SELECT name FROM dtb_maker WHERE maker_id = ?", $this->arrSearchData['maker_id']); 122 }123 124 // 商品名検索条件122 } 123 124 // 商品名検索条件 125 125 if (strlen($this->arrSearchData['name']) == 0) { 126 126 $this->arrSearch['name'] = "指定なし"; 127 127 } else { 128 128 $this->arrSearch['name'] = $this->arrSearchData['name']; 129 }129 } 130 130 131 131 // レイアウトデザインを取得 … … 133 133 $layout->sfGetPageLayout($this, false, "products/list.php"); 134 134 135 foreach ($this->arrProducts as $arrProduct) { 136 $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProduct['product_id']});\n"; 137 } 138 135 139 if ($this->inCart) { 136 140 // 商品IDの正当性チェック … … 144 148 $classcategory_id1 = $this->arrForm['classcategory_id1']; 145 149 $classcategory_id2 = $this->arrForm['classcategory_id2']; 146 // 規格1が設定されていない場合150 // 規格1が設定されていない場合 147 151 if (!$this->tpl_classcat_find1[$product_id]) { 148 $classcategory_id1 = '0';149 }150 // 規格2が設定されていない場合152 $classcategory_id1 = '0'; 153 } 154 // 規格2が設定されていない場合 151 155 if (!$this->tpl_classcat_find2[$product_id]) { 152 $classcategory_id2 = '0';153 }156 $classcategory_id2 = '0'; 157 } 154 158 $objCartSess = new SC_CartSession(); 155 159 $objCartSess->addProduct(array($product_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']); 156 $this->sendRedirect($this->getLocation(URL_CART_TOP)); 157 exit; 158 } 159 $this->tpl_onload .= "fnSetSelect(document.product_form{$product_id}, '{$this->arrForm['classcategory_id2']}');"; 160 $this->sendRedirect($this->getLocation(URL_CART_TOP)); 161 exit; 162 } 160 163 foreach (array_keys($this->arrProducts) as $key) { 161 164 $arrProduct =& $this->arrProducts[$key]; … … 165 168 $arrProduct['quantity'] = $this->arrForm['quantity']; 166 169 $arrProduct['arrErr'] = $arrErr; 170 $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProduct['product_id']}, '{$this->arrForm['classcategory_id2']}');\n"; 167 171 } 168 172 } 169 173 } 174 $this->tpl_javascript .= 'function fnOnLoad(){' . $js_fnOnLoad . '}'; 175 $this->tpl_onload .= 'fnOnLoad(); '; 170 176 171 177 $this->tpl_rnd = SC_Utils_Ex::sfGetRandomString(3); … … 214 220 $count = $objQuery->count("dtb_best_products", "category_id = ?", array($this->arrSearchData['category_id'])); 215 221 216 // 商品一覧の表示処理222 // 商品一覧の表示処理 217 223 $this->lfDispProductsList(); 218 224 219 // 検索条件を画面に表示220 // カテゴリー検索条件225 // 検索条件を画面に表示 226 // カテゴリー検索条件 221 227 if ($this->arrSearchData['category_id'] == 0) { 222 228 $this->arrSearch['category'] = "指定なし"; 223 229 } else { 224 $arrCat = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($category_id));230 $arrCat = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($category_id)); 225 231 $this->arrSearch['category'] = $arrCat; 226 }227 228 // 商品名検索条件232 } 233 234 // 商品名検索条件 229 235 if ($this->arrForm['name'] === "") { 230 236 $this->arrSearch['name'] = "指定なし"; 231 } else {237 } else { 232 238 $this->arrSearch['name'] = $this->arrForm['name']; 233 }239 } 234 240 235 241 // ページ送り機能用のURLを作成する。 … … 287 293 if ( 288 294 !SC_Utils_Ex::sfIsInt($category_id) 289 || SC_Utils_Ex::sfIsZeroFilling($category_id)295 || SC_Utils_Ex::sfIsZeroFilling($category_id) 290 296 || !$objDb->sfIsRecord('dtb_category', 'category_id', (array)$category_id, 'del_flg = 0') 291 297 ) { 292 298 SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); 293 299 } 294 300 295 301 // 指定されたカテゴリIDを元に正しいカテゴリIDを取得する。 … … 468 474 // ▲商品詳細取得 469 475 470 // 規格名一覧 471 $arrClassName = $objDb->sfGetIDValueList("dtb_class", "class_id", "name"); 472 // 規格分類名一覧 473 $arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 476 $arrProductId = array(); 474 477 // 規格セレクトボックス設定 475 for ($i = 0; $i < count($this->arrProducts); $i++) {476 $ this->lfMakeSelect($this->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName);478 foreach ($this->arrProducts as $product) { 479 $arrProductId[] = $product['product_id']; 477 480 // 購入制限数を取得 478 $this->lfGetSaleLimit($this->arrProducts[$i]); 479 } 480 } 481 482 /* 規格セレクトボックスの作成 */ 483 function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) { 484 485 $classcat_find1 = false; 486 $classcat_find2 = false; 487 // 在庫ありの商品の有無 488 $stock_find = false; 489 490 // 商品規格情報の取得 491 $arrProductsClass = $this->lfGetProductsClass($product_id); 492 493 // 規格1クラス名の取得 494 $this->tpl_class_name1[$product_id] = 495 isset($arrClassName[$arrProductsClass[0]['class_id1']]) 496 ? $arrClassName[$arrProductsClass[0]['class_id1']] 497 : ""; 498 499 // 規格2クラス名の取得 500 $this->tpl_class_name2[$product_id] = 501 isset($arrClassName[$arrProductsClass[0]['class_id2']]) 502 ? $arrClassName[$arrProductsClass[0]['class_id2']] 503 : ""; 504 505 // すべての組み合わせ数 506 $count = count($arrProductsClass); 507 508 $classcat_id1 = ""; 509 510 $arrSele = array(); 511 $arrList = array(); 512 513 $list_id = 0; 514 $arrList[0] = "\tlist". $product_id. "_0 = new Array('選択してください'"; 515 $arrVal[0] = "\tval". $product_id. "_0 = new Array(''"; 516 517 for ($i = 0; $i < $count; $i++) { 518 // 在庫のチェック 519 if ($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 520 continue; 521 } 522 523 $stock_find = true; 524 525 // 規格1のセレクトボックス用 526 if ($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']) { 527 $arrList[$list_id].=");\n"; 528 $arrVal[$list_id].=");\n"; 529 $classcat_id1 = $arrProductsClass[$i]['classcategory_id1']; 530 $arrSele[$classcat_id1] = $arrClassCatName[$classcat_id1]; 531 $list_id++; 532 533 $arrList[$list_id] = ""; 534 $arrVal[$list_id] = ""; 535 } 536 537 // 規格2のセレクトボックス用 538 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 539 540 // セレクトボックス表示値 541 if ($arrList[$list_id] == "") { 542 $arrList[$list_id] = "\tlist". $product_id. "_". $list_id. " = new Array('選択してください', '". $arrClassCatName[$classcat_id2]. "'"; 543 } else { 544 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 545 } 546 547 // セレクトボックスPOST値 548 if ($arrVal[$list_id] == "") { 549 $arrVal[$list_id] = "\tval". $product_id. "_". $list_id. " = new Array('', '". $classcat_id2. "'"; 550 } else { 551 $arrVal[$list_id].= ", '".$classcat_id2."'"; 552 } 553 } 554 555 $arrList[$list_id].=");\n"; 556 $arrVal[$list_id].=");\n"; 557 481 $this->lfGetSaleLimit($product); 482 } 483 484 require_once CLASS_PATH . 'SC_Product.php'; 485 $objProduct = new SC_Product($arrProductId); 486 487 // 規格1クラス名 488 $this->tpl_class_name1 = $objProduct->className1; 489 490 // 規格2クラス名 491 $this->tpl_class_name2 = $objProduct->className2; 492 558 493 // 規格1 559 $this->arrClassCat1[$product_id] = $arrSele; 560 561 $lists = "\tlists".$product_id. " = new Array("; 562 $no = 0; 563 foreach($arrList as $val) { 564 $this->tpl_javascript.= $val; 565 if ($no != 0) { 566 $lists.= ",list". $product_id. "_". $no; 567 } else { 568 $lists.= "list". $product_id. "_". $no; 569 } 570 $no++; 571 } 572 $this->tpl_javascript.= $lists.");\n"; 573 574 $vals = "\tvals".$product_id. " = new Array("; 575 $no = 0; 576 foreach($arrVal as $val) { 577 $this->tpl_javascript.= $val; 578 if ($no != 0) { 579 $vals.= ",val". $product_id. "_". $no; 580 } else { 581 $vals.= "val". $product_id. "_". $no; 582 } 583 $no++; 584 } 585 $this->tpl_javascript.= $vals.");\n"; 586 587 // 選択されている規格2ID 588 if (!isset($this->arrForm['classcategory_id2']) || !is_numeric($this->arrForm['classcategory_id2'])) { 589 $this->arrForm['classcategory_id2'] = ''; 590 } 591 494 $this->arrClassCat1 = $objProduct->classCats1; 495 592 496 // 規格1が設定されている 593 if ($arrProductsClass[0]['classcategory_id1'] != '0') { 594 $classcat_find1 = true; 595 } 596 497 $this->tpl_classcat_find1 = $objProduct->classCat1_find; 597 498 // 規格2が設定されている 598 if ($arrProductsClass[0]['classcategory_id2'] != '0') { 599 $classcat_find2 = true; 600 } 601 602 $this->tpl_classcat_find1[$product_id] = $classcat_find1; 603 $this->tpl_classcat_find2[$product_id] = $classcat_find2; 604 $this->tpl_stock_find[$product_id] = $stock_find; 605 } 606 607 /* 商品規格情報の取得 */ 608 function lfGetProductsClass($product_id) { 609 $arrRet = array(); 610 if (SC_Utils_Ex::sfIsInt($product_id)) { 611 // 商品規格取得 612 $objQuery = new SC_Query(); 613 $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited"; 614 $table = "vw_product_class AS prdcls"; 615 $where = "product_id = ?"; 616 $objQuery->setorder("rank1 DESC, rank2 DESC"); 617 $arrRet = $objQuery->select($col, $table, $where, array($product_id)); 618 } 619 return $arrRet; 499 $this->tpl_classcat_find2 = $objProduct->classCat2_find; 500 501 $this->tpl_stock_find = $objProduct->stock_find; 502 503 $productsClassCategories = $objProduct->classCategories; 504 505 require_once DATA_PATH . 'module/Services/JSON.php'; 506 $objJson = new Services_JSON(); 507 $this->tpl_javascript .= 'productsClassCategories = ' . $objJson->encode($productsClassCategories) . '; '; 620 508 } 621 509 … … 639 527 640 528 // 購入制限数の設定 529 // XXX 標準実装では「tpl_sale_limit」は利用されていないようである。カスタマイズ用? 641 530 function lfGetSaleLimit($arrProduct) { 642 531 //在庫が無限または購入制限値が設定値より大きい場合 … … 670 559 //最小表示件数を選択 671 560 $this->disp_number = current(array_keys($this->arrPRODUCTLISTMAX)); 672 561 } 673 562 $this->tpl_pageno = $this->arrForm['pageno']; 674 563 $this->inCart = strlen($this->arrForm['product_id']) >= 1; 675 }564 } 676 565 } 677 566 ?> -
branches/comu-ver2/html/user_data/packages/default/css/products.css
r18207 r18277 122 122 } 123 123 124 div.listrightblock .soldout {125 clear: both;126 }127 128 124 div.listrightblock .in_cart { 129 125 margin: 20px auto 5px 130px; … … 159 155 div.listrightblock .cartbtn { 160 156 clear: both; 161 text-align: center;162 157 } 163 158 … … 208 203 209 204 div#detailrightblock dl { 210 padding: 15px 0 00;205 padding: 0; 211 206 } 212 207 213 208 div#detailrightblock dt { 214 209 font-weight: bold; 210 margin: 15px 0 0 0; 215 211 padding: 0 0 0 15px; 216 212 background: url("../img/common/arrow_gray.gif") no-repeat left center; … … 235 231 } 236 232 233 /* 商品共通 */ 234 235 .cartbtn { 236 text-align: center; 237 } 238 237 239 /* サブタイトル 238 240 ----------------------------------------------- */
Note: See TracChangeset
for help on using the changeset viewer.