Changeset 20366
- Timestamp:
- 2011/02/24 06:00:49 (13 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:20365
- bzr:committer:
- Kentaro Ohkouchi <nanasess@fsm.ne.jp>
- bzr:file-ids:
data/Smarty/templates/default/products/detail.tpl 19775@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_5-dev%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fproducts%2Fdetail.tpl
data/Smarty/templates/default/products/list.tpl 19775@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_5-dev%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fproducts%2Flist.tpl
data/Smarty/templates/sphone/products/detail.tpl 19775@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_5-dev%2Fdata%2FSmarty%2Ftemplates%2Fsphone%2Fproducts%2Fdetail.tpl
html/js/products.js products.js-20110223205405-tr2pdhnwxtjiqrzr-1- bzr:mapping-version:
- v4
- bzr:merge:
nanasess@fsm.ne.jp-20110223205828-qk92u6l890okr0yh- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- nanasess@fsm.ne.jp-20110223210044-glvsghl5oi2fo0y4
- bzr:revno:
- 3094
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:text-revisions:
data/Smarty/templates/default/products/detail.tpl nanasess@fsm.ne.jp-20110223205828-qk92u6l890okr0yh
data/Smarty/templates/default/products/list.tpl nanasess@fsm.ne.jp-20110223205828-qk92u6l890okr0yh
data/Smarty/templates/sphone/products/detail.tpl nanasess@fsm.ne.jp-20110223205828-qk92u6l890okr0yh
html/js/products.js nanasess@fsm.ne.jp-20110223205828-qk92u6l890okr0yh- bzr:timestamp:
- 2011-02-24 06:00:44.628000021 +0900
- bzr:user-agent:
- bzr2.2.2+bzr-svn1.0.4
- svn:original-date:
- 2011-02-23T21:00:44.628000Z
- Location:
- branches/version-2_5-dev
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/default/products/detail.tpl
r20347 r20366 20 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 21 *}--> 22 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script> 22 23 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.js"></script> 23 24 <link rel="stylesheet" type="text/css" href="<!--{$smarty.const.ROOT_URLPATH}-->js/jquery.facebox/facebox.css" media="screen" /> … … 25 26 // 規格2に選択肢を割り当てる。 26 27 function fnSetClassCategories(form, classcat_id2_selected) { 27 sele1 = form.classcategory_id1; 28 sele2 = form.classcategory_id2; 29 30 if (sele1) { 31 if (sele2) { 32 // 規格2の選択肢をクリア 33 count = sele2.options.length; 34 for(i = count; i >= 0; i--) { 35 sele2.options[i] = null; 36 } 37 38 // 規格2に選択肢を割り当てる 39 classcats = classCategories[sele1.value]; 40 i = 0; 41 for (var classcat_id2_key in classcats) { 42 classcategory_id2 = classcats[classcat_id2_key].classcategory_id2; 43 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2); 44 if (classcategory_id2 == classcat_id2_selected) { 45 sele2.options[i].selected = true; 46 } 47 i++; 48 } 49 } 50 fnCheckStock(form); 51 } 52 } 53 function fnCheckStock(form) { 54 classcat_id1 = form.classcategory_id1.value; 55 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : ''; 56 classcat2 = classCategories[classcat_id1]['#' + classcat_id2]; 57 58 // 商品コード 59 eleDefault = document.getElementById('product_code_default'); 60 eleDynamic = document.getElementById('product_code_dynamic'); 61 if ( 62 classcat2 63 && typeof classcat2.product_code != 'undefined' 64 ) { 65 eleDefault.style.display = 'none'; 66 eleDynamic.innerHTML = classcat2.product_code; 67 } else { 68 eleDefault.style.display = ''; 69 eleDynamic.innerHTML = ''; 70 eleDynamic.style.display = 'none'; 71 } 72 73 // 在庫(品切れ) 74 eleDefault = document.getElementById('cartbtn_default'); 75 eleDynamic = document.getElementById('cartbtn_dynamic'); 76 if ( 77 classcat2 78 && classcat2.stock_find === false 79 ) { 80 eleDefault.style.display = 'none'; 81 eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。'; 82 eleDynamic.style.display = ''; 83 } else { 84 eleDefault.style.display = ''; 85 eleDynamic.innerHTML = ''; 86 eleDynamic.style.display = 'none'; 87 } 88 89 // 通常価格 90 eleDefault = document.getElementById('price01_default'); 91 eleDynamic = document.getElementById('price01_dynamic'); 92 if (eleDefault && eleDynamic) { 93 if ( 94 classcat2 95 && typeof classcat2.price01 != 'undefined' 96 && String(classcat2.price01).length >= 1 97 ) { 98 eleDefault.style.display = 'none'; 99 eleDynamic.innerHTML = classcat2.price01; 100 eleDynamic.style.display = ''; 101 } else { 102 eleDefault.style.display = ''; 103 eleDynamic.innerHTML = ''; 104 eleDynamic.style.display = 'none'; 105 } 106 } 107 108 // 販売価格 109 eleDefault = document.getElementById('price02_default'); 110 eleDynamic = document.getElementById('price02_dynamic'); 111 if ( 112 classcat2 113 && typeof classcat2.price02 != 'undefined' 114 && String(classcat2.price02).length >= 1 115 ) { 116 eleDefault.style.display = 'none'; 117 eleDynamic.innerHTML = classcat2.price02; 118 eleDynamic.style.display = ''; 119 } else { 120 eleDefault.style.display = ''; 121 eleDynamic.innerHTML = ''; 122 eleDynamic.style.display = 'none'; 123 } 124 125 // ポイント 126 eleDefault = document.getElementById('point_default'); 127 eleDynamic = document.getElementById('point_dynamic'); 128 if ( 129 classcat2 130 && typeof classcat2.point != 'undefined' 131 && String(classcat2.point).length >= 1 132 ) { 133 eleDefault.style.display = 'none'; 134 eleDynamic.innerHTML = classcat2.point; 135 eleDynamic.style.display = ''; 136 } else { 137 eleDefault.style.display = ''; 138 eleDynamic.innerHTML = ''; 139 eleDynamic.style.display = 'none'; 140 } 141 // 商品規格 142 eleDynamic = document.getElementById('product_class_id'); 143 if ( 144 classcat2 145 && typeof classcat2.product_class_id != 'undefined' 146 && String(classcat2.product_class_id).length >= 1 147 ) { 148 eleDynamic.value = classcat2.product_class_id; 149 eleDynamic.style.display = ''; 150 } else { 151 eleDynamic.value = '' 152 } 153 // 商品種別 154 eleDynamic = document.getElementById('product_type'); 155 if ( 156 classcat2 157 && typeof classcat2.product_type != 'undefined' 158 && String(classcat2.product_type).length >= 1 159 ) { 160 eleDynamic.value = classcat2.product_type; 161 eleDynamic.style.display = ''; 162 } else { 163 eleDynamic.value = '' 164 } 28 var $form = $(form); 29 var product_id = $form.find('input[name=product_id]').val(); 30 var $sele1 = $form.find('select[name=classcategory_id1]'); 31 var $sele2 = $form.find('select[name=classcategory_id2]'); 32 setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected); 165 33 } 166 34 $(document).ready(function() { … … 175 43 <!--▼CONTENTS--> 176 44 <div id="undercolumn" class="product product_detail"> 45 <form name="form1" id="form1" method="post" action="?"> 177 46 <div id="detailarea" class="clearfix"> 178 47 <div id="detailphotobloc"> … … 311 180 <div class="cart_area clearfix"> 312 181 313 <form name="form1" id="form1" method="post" action="?">314 182 <input type="hidden" name="mode" value="cart" /> 315 183 <input type="hidden" name="product_id" value="<!--{$tpl_product_id}-->" /> … … 325 193 <li><!--{$tpl_class_name1|h}-->:</li> 326 194 <li> 327 <select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);">195 <select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->"> 328 196 <!--{html_options options=$arrClassCat1 selected=$arrForm.classcategory_id1.value}--> 329 197 </select> … … 339 207 <li><!--{$tpl_class_name2|h}-->:</li> 340 208 <li> 341 <select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);">209 <select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->"> 342 210 </select> 343 211 <!--{if $arrErr.classcategory_id2 != ""}--> … … 390 258 <!--{/if}--> 391 259 </div> 392 </form>393 260 </div> 394 261 </div> 395 262 <!--▲買い物かご--> 396 263 </div> 264 </form> 397 265 398 266 <!--詳細ここまで--> -
branches/version-2_5-dev/data/Smarty/templates/default/products/list.tpl
r20340 r20366 20 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 21 *}--> 22 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script> 22 23 <script type="text/javascript">//<![CDATA[ 23 // 規格2に選択肢を割り当てる。24 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 classcategory_id2 = classcats[classcat_id2_key].classcategory_id2; 42 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2); 43 if (classcategory_id2 == classcat_id2_selected) { 44 sele2.options[i].selected = true; 45 } 46 i++; 47 } 48 } 49 fnCheckStock(form); 50 } 25 var $form = $(form); 26 var product_id = $form.find('input[name=product_id]').val(); 27 var $sele1 = $form.find('select[name=classcategory_id1]'); 28 var $sele2 = $form.find('select[name=classcategory_id2]'); 29 setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected); 51 30 } 52 31 // 並び順を変更 … … 77 56 fnSetVal("product_type", productForm["product_type"].value); 78 57 fnSubmit(); 79 }80 function fnCheckStock(form) {81 product_id = form.product_id.value;82 classcat_id1 = form.classcategory_id1.value;83 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : '';84 classcat2 = productsClassCategories[product_id][classcat_id1]['#' + classcat_id2];85 86 // 在庫(品切れ)87 eleDefault = document.getElementById('cartbtn_default_' + product_id);88 eleDynamic = document.getElementById('cartbtn_dynamic_' + product_id);89 if (90 classcat291 && classcat2.stock_find === false92 ) {93 eleDefault.style.display = 'none';94 eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。';95 } else {96 eleDefault.style.display = '';97 eleDynamic.style.display = 'none';98 eleDynamic.innerHTML = '';99 }100 101 // 販売価格102 eleDefault = document.getElementById('price02_default_' + product_id);103 eleDynamic = document.getElementById('price02_dynamic_' + product_id);104 if (105 classcat2106 && typeof classcat2.price02 != 'undefined'107 && String(classcat2.price02).length >= 1108 ) {109 eleDefault.style.display = 'none';110 eleDynamic.innerHTML = classcat2.price02;111 } else {112 eleDefault.style.display = '';113 eleDynamic.innerHTML = '';114 }115 // 商品規格116 eleDynamic = document.getElementById('product_class_id' + product_id);117 if (118 classcat2119 && typeof classcat2.product_class_id != 'undefined'120 && String(classcat2.product_class_id).length >= 1121 ) {122 eleDynamic.value = classcat2.product_class_id;123 } else {124 eleDynamic.value = ''125 }126 // 商品種別127 eleDynamic = document.getElementById('product_type' + product_id);128 if (129 classcat2130 && typeof classcat2.product_type != 'undefined'131 && String(classcat2.product_type).length >= 1132 ) {133 eleDynamic.value = classcat2.product_type;134 } else {135 eleDynamic.value = ''136 }137 58 } 138 59 //]]> … … 226 147 <!--{assign var=arrErr value=$arrProduct.arrErr}--> 227 148 <!--▼商品--> 228 <div class="list_area clearfix"> 229 <a name="product<!--{$id|h}-->"></a> 230 <div class="listphoto"> 231 <!--★画像★--> 232 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" class="over"><!--商品写真--><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/<!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->" alt="<!--{$arrProduct.name|h}-->" class="picture" /></a> 233 </div> 234 235 <div class="listrightbloc"> 236 <!--▼商品ステータス--> 237 <!--{if count($productStatus[$id]) > 0}--> 238 <ul class="status_icon clearfix"> 239 <!--{foreach from=$productStatus[$id] item=status}--> 240 <li> 241 <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->"/> 242 </li> 243 <!--{/foreach}--> 244 </ul> 245 <!--{/if}--> 246 <!--▲商品ステータス--> 247 248 <!--★商品名★--> 249 <h3> 250 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" name="product<!--{$arrProduct.product_id}-->"><!--{$arrProduct.name|h}--></a> 251 </h3> 252 <!--★価格★--> 253 <div class="pricebox sale_price"> 254 <!--{$smarty.const.SALE_PRICE_TITLE}-->(税込): 255 <span class="price"> 256 <span id="price02_default_<!--{$id}-->"> 257 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 258 <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 259 <!--{else}--> 149 <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;"> 150 <div class="list_area clearfix"> 151 <a name="product<!--{$id|h}-->"></a> 152 <div class="listphoto"> 153 <!--★画像★--> 154 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" class="over"><!--商品写真--><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/<!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->" alt="<!--{$arrProduct.name|h}-->" class="picture" /></a> 155 </div> 156 157 <div class="listrightbloc"> 158 <!--▼商品ステータス--> 159 <!--{if count($productStatus[$id]) > 0}--> 160 <ul class="status_icon clearfix"> 161 <!--{foreach from=$productStatus[$id] item=status}--> 162 <li> 163 <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->"/> 164 </li> 165 <!--{/foreach}--> 166 </ul> 167 <!--{/if}--> 168 <!--▲商品ステータス--> 169 170 <!--★商品名★--> 171 <h3> 172 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" name="product<!--{$arrProduct.product_id}-->"><!--{$arrProduct.name|h}--></a> 173 </h3> 174 <!--★価格★--> 175 <div class="pricebox sale_price"> 176 <!--{$smarty.const.SALE_PRICE_TITLE}-->(税込): 177 <span class="price"> 178 <span id="price02_default_<!--{$id}-->"> 179 <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> 180 <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 181 <!--{else}--> 260 182 <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 261 <!--{/if}--> 262 </span><span id="price02_dynamic_<!--{$id}-->"></span> 263 円</span> 264 </div> 265 266 <!--★コメント★--> 267 <div class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></div> 268 269 <!--★商品詳細を見る★--> 270 <div class="detail_btn"> 271 <!--{assign var=name value="detail`$id`"}--> 272 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail_on.jpg','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg','<!--{$name}-->');"> 273 <img src="<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg" alt="商品詳細を見る" name="<!--{$name}-->" id="<!--{$name}-->" /></a> 274 </div> 275 276 <!--▼買い物かご--> 277 <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;"> 278 <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> 279 <input type="hidden" name="product_class_id" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> 280 <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> 281 282 <div class="cart_area clearfix"> 283 <!--{if $tpl_stock_find[$id]}--> 284 <!--{if $tpl_classcat_find1[$id]}--> 285 <div class="classlist"> 286 <dl class="size01 clearfix"> 183 <!--{/if}--> 184 </span><span id="price02_dynamic_<!--{$id}-->"></span> 185 円</span> 186 </div> 187 188 <!--★コメント★--> 189 <div class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></div> 190 191 <!--★商品詳細を見る★--> 192 <div class="detail_btn"> 193 <!--{assign var=name value="detail`$id`"}--> 194 <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail_on.jpg','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg','<!--{$name}-->');"> 195 <img src="<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg" alt="商品詳細を見る" name="<!--{$name}-->" id="<!--{$name}-->" /></a> 196 </div> 197 198 <!--▼買い物かご--> 199 <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> 200 <input type="hidden" name="product_class_id" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> 201 <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> 202 203 <div class="cart_area clearfix"> 204 <!--{if $tpl_stock_find[$id]}--> 205 <!--{if $tpl_classcat_find1[$id]}--> 206 <div class="classlist"> 207 <dl class="size01 clearfix"> 287 208 <!--▼規格1--> 288 209 <dt><!--{$tpl_class_name1[$id]|h}-->:</dt> 289 210 <dd> 290 <select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);">211 <select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->"> 291 212 <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}--> 292 213 </select> … … 297 218 <!--▲規格1--> 298 219 </dl> 299 <dl class="size02 clearfix">300 < !--{if $tpl_classcat_find2[$id]}-->220 <!--{if $tpl_classcat_find2[$id]}--> 221 <dl class="size02 clearfix"> 301 222 <!--▼規格2--> 302 223 <dt><!--{$tpl_class_name2[$id]|h}-->:</dt> 303 224 <dd> 304 <select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);">225 <select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->"> 305 226 </select> 306 227 <!--{if $arrErr.classcategory_id2 != ""}--> … … 309 230 </dd> 310 231 <!--▲規格2--> 311 </dl> 312 </div> 313 <!--{/if}--> 314 <!--{/if}--> 315 316 <div class="cartin clearfix"> 232 </dl> 233 <!--{/if}--> 234 </div> 235 <!--{/if}--> 236 <div class="cartin clearfix"> 317 237 <div class="quantity"> 318 238 数量:<input type="text" name="quantity" class="box" value="<!--{$arrProduct.quantity|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" /> … … 329 249 </div> 330 250 </div> 331 332 251 <!--{else}--> 333 <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div>252 <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div> 334 253 <!--{/if}--> 335 336 </div> 337 </form> 254 </div> 338 255 <!--▲買い物かご--> 339 </div> 340 </div> 256 </div> 257 </div> 258 </form> 341 259 <!--▲商品--> 342 260 -
branches/version-2_5-dev/data/Smarty/templates/sphone/products/detail.tpl
r20337 r20366 20 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 21 *}--> 22 <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script> 22 23 <script type="text/javascript">//<![CDATA[ 23 24 // 規格2に選択肢を割り当てる。 24 25 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 classcategory_id2 = classcats[classcat_id2_key].classcategory_id2; 41 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2); 42 if (classcategory_id2 == classcat_id2_selected) { 43 sele2.options[i].selected = true; 44 } 45 i++; 46 } 47 } 48 fnCheckStock(form); 49 } 50 } 51 function fnCheckStock(form) { 52 classcat_id1 = form.classcategory_id1.value; 53 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : ''; 54 classcat2 = classCategories[classcat_id1]['#' + classcat_id2]; 55 56 // 商品コード 57 eleDefault = document.getElementById('product_code_default'); 58 eleDynamic = document.getElementById('product_code_dynamic'); 59 if ( 60 classcat2 61 && typeof classcat2.product_code != 'undefined' 62 ) { 63 eleDefault.style.display = 'none'; 64 eleDynamic.innerHTML = classcat2.product_code; 65 } else { 66 eleDefault.style.display = ''; 67 eleDynamic.innerHTML = ''; 68 } 69 70 // 在庫(品切れ) 71 eleDefault = document.getElementById('cartbtn_default'); 72 eleDynamic = document.getElementById('cartbtn_dynamic'); 73 if ( 74 classcat2 75 && classcat2.stock_find === false 76 ) { 77 eleDefault.style.display = 'none'; 78 eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。'; 79 } else { 80 eleDefault.style.display = ''; 81 eleDynamic.innerHTML = ''; 82 } 83 84 // 通常価格 85 eleDefault = document.getElementById('price01_default'); 86 eleDynamic = document.getElementById('price01_dynamic'); 87 if (eleDefault && eleDynamic) { 88 if ( 89 classcat2 90 && typeof classcat2.price01 != 'undefined' 91 && String(classcat2.price01).length >= 1 92 ) { 93 eleDefault.style.display = 'none'; 94 eleDynamic.innerHTML = classcat2.price01; 95 } else { 96 eleDefault.style.display = ''; 97 eleDynamic.innerHTML = ''; 98 } 99 } 100 101 // 販売価格 102 eleDefault = document.getElementById('price02_default'); 103 eleDynamic = document.getElementById('price02_dynamic'); 104 if ( 105 classcat2 106 && typeof classcat2.price02 != 'undefined' 107 && String(classcat2.price02).length >= 1 108 ) { 109 eleDefault.style.display = 'none'; 110 eleDynamic.innerHTML = classcat2.price02; 111 } else { 112 eleDefault.style.display = ''; 113 eleDynamic.innerHTML = ''; 114 } 115 116 // ポイント 117 eleDefault = document.getElementById('point_default'); 118 eleDynamic = document.getElementById('point_dynamic'); 119 if ( 120 classcat2 121 && typeof classcat2.point != 'undefined' 122 && String(classcat2.point).length >= 1 123 ) { 124 eleDefault.style.display = 'none'; 125 eleDynamic.innerHTML = classcat2.point; 126 } else { 127 eleDefault.style.display = ''; 128 eleDynamic.innerHTML = ''; 129 } 130 // 商品規格 131 eleDynamic = document.getElementById('product_class_id'); 132 if ( 133 classcat2 134 && typeof classcat2.product_class_id != 'undefined' 135 && String(classcat2.product_class_id).length >= 1 136 ) { 137 eleDynamic.value = classcat2.product_class_id; 138 } else { 139 eleDynamic.value = '' 140 } 141 // 商品種別 142 eleDynamic = document.getElementById('product_type'); 143 if ( 144 classcat2 145 && typeof classcat2.product_type != 'undefined' 146 && String(classcat2.product_type).length >= 1 147 ) { 148 eleDynamic.value = classcat2.product_type; 149 } else { 150 eleDynamic.value = '' 151 } 26 var $form = $(form); 27 var product_id = $form.find('input[name=product_id]').val(); 28 var $sele1 = $form.find('select[name=classcategory_id1]'); 29 var $sele2 = $form.find('select[name=classcategory_id2]'); 30 setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected); 152 31 } 153 32 //]]>
Note: See TracChangeset
for help on using the changeset viewer.