source: branches/version-2_5-dev/data/Smarty/templates/default/products/list.tpl @ 19983

Revision 19983, 17.2 KB checked in by Seasoft, 13 years ago (diff)

#834(パスに関わるパラメータ名が不適切)

  • TPL_DIR -> TPL_URLPATH
  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2 * This file is part of EC-CUBE
3 *
4 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 *}-->
22<script type="text/javascript">//<![CDATA[
23// 規格2に選択肢を割り当てる。
24function 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            }
47        }
48        fnCheckStock(form);
49    }
50}
51// 並び順を変更
52function fnChangeOrderby(orderby) {
53    fnSetVal('orderby', orderby);
54    fnSetVal('pageno', 1);
55    fnSubmit();
56}
57// 表示件数を変更
58function fnChangeDispNumber(dispNumber) {
59    fnSetVal('disp_number', dispNumber);
60    fnSetVal('pageno', 1);
61    fnSubmit();
62}
63// カゴに入れる
64function fnInCart(productForm) {
65    var product_id = productForm["product_id"].value;
66    fnChangeAction("?#product" + product_id);
67    if (productForm["classcategory_id1"]) {
68        fnSetVal("classcategory_id1", productForm["classcategory_id1"].value);
69    }
70    if (productForm["classcategory_id2"]) {
71        fnSetVal("classcategory_id2", productForm["classcategory_id2"].value);
72    }
73    fnSetVal("quantity", productForm["quantity"].value);
74    fnSetVal("product_id", productForm["product_id"].value);
75    fnSetVal("product_class_id", productForm["product_class_id"].value);
76    fnSetVal("product_type", productForm["product_type"].value);
77    fnSubmit();
78}
79function fnCheckStock(form) {
80    product_id = form.product_id.value;
81    classcat_id1 = form.classcategory_id1.value;
82    classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : 0;
83    classcat2 = productsClassCategories[product_id][classcat_id1][classcat_id2];
84   
85    // 在庫(品切れ)
86    eleDefault = document.getElementById('cartbtn_default_' + product_id);
87    eleDynamic = document.getElementById('cartbtn_dynamic_' + product_id);
88    if (
89           classcat2
90        && classcat2.stock_find === false
91    ) {
92        eleDefault.style.display = 'none';
93        eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。';
94    } else {
95        eleDefault.style.display = '';
96        eleDynamic.innerHTML = '';
97    }
98   
99    // 販売価格
100    eleDefault = document.getElementById('price02_default_' + product_id);
101    eleDynamic = document.getElementById('price02_dynamic_' + product_id);
102    if (
103           classcat2
104        && typeof classcat2.price02 != 'undefined'
105        && String(classcat2.price02).length >= 1
106    ) {
107        eleDefault.style.display = 'none';
108        eleDynamic.innerHTML = classcat2.price02;
109    } else {
110        eleDefault.style.display = '';
111        eleDynamic.innerHTML = '';
112    }
113    // 商品規格
114    eleDynamic = document.getElementById('product_class_id' + product_id);
115    if (
116           classcat2
117        && typeof classcat2.product_class_id != 'undefined'
118        && String(classcat2.product_class_id).length >= 1
119    ) {
120        eleDynamic.value = classcat2.product_class_id;
121    } else {
122        eleDynamic.value = ''
123    }
124    // 商品種別
125    eleDynamic = document.getElementById('product_type' + product_id);
126    if (
127           classcat2
128        && typeof classcat2.product_type != 'undefined'
129        && String(classcat2.product_type).length >= 1
130    ) {
131        eleDynamic.value = classcat2.product_type;
132    } else {
133        eleDynamic.value = ''
134    }
135}
136//]]>
137</script>
138
139<!--▼CONTENTS-->
140<div id="undercolumn" class="product product_list">
141    <form name="form1" id="form1" method="get" action="?">
142        <input type="hidden" name="mode" value="<!--{$mode|h}-->" />
143        <!--{* ▼検索条件 *}-->
144        <input type="hidden" name="category_id" value="<!--{$arrSearchData.category_id|h}-->" />
145        <input type="hidden" name="maker_id" value="<!--{$arrSearchData.maker_id|h}-->" />
146        <input type="hidden" name="name" value="<!--{$arrSearchData.name|h}-->" />
147        <!--{* ▲検索条件 *}-->
148        <!--{* ▼ページナビ関連 *}-->
149        <input type="hidden" name="orderby" value="<!--{$orderby|h}-->" />
150        <input type="hidden" name="disp_number" value="<!--{$disp_number|h}-->" />
151        <input type="hidden" name="pageno" value="<!--{$tpl_pageno|h}-->" />
152        <!--{* ▲ページナビ関連 *}-->
153        <!--{* ▼注文関連 *}-->
154        <input type="hidden" name="product_id" value="" />
155        <input type="hidden" name="classcategory_id1" value="" />
156        <input type="hidden" name="classcategory_id2" value="" />
157        <input type="hidden" name="product_class_id" value="" />
158        <input type="hidden" name="product_type" value="" />
159        <input type="hidden" name="quantity" value="" />
160        <!--{* ▲注文関連 *}-->
161        <input type="hidden" name="rnd" value="<!--{$tpl_rnd|h}-->" />
162    </form>
163   
164    <!--★タイトル★-->
165    <h2 class="title"><!--{$tpl_subtitle|h}--></h2>
166   
167    <!--▼検索条件-->
168    <!--{if $tpl_subtitle == "検索結果"}-->
169        <ul class="pagecondarea">
170            <li><strong>商品カテゴリ:</strong><!--{$arrSearch.category|h}--></li>
171        <!--{if $arrSearch.maker|strlen >= 1}--><li><strong>メーカー:</strong><!--{$arrSearch.maker|h}--></li><!--{/if}-->
172            <li><strong>商品名:</strong><!--{$arrSearch.name|h}--></li>
173        </ul>
174    <!--{/if}-->
175    <!--▲検索条件-->
176
177    <!--▼ページナビ(本文)-->
178    <!--{capture name=page_navi_body}-->
179        <div class="pagenumberarea">
180            <div class="change">
181                <!--{if $orderby != 'price'}-->
182                    <a href="javascript:fnChangeOrderby('price');">価格順</a>
183                <!--{else}-->
184                    <strong>価格順</strong>
185                <!--{/if}-->&nbsp;
186                <!--{if $orderby != "date"}-->
187                        <a href="javascript:fnChangeOrderby('date');">新着順</a>
188                <!--{else}-->
189                    <strong>新着順</strong>
190                <!--{/if}-->
191                表示件数
192                <select name="disp_number" onchange="javascript:fnChangeDispNumber(this.value);">
193                    <!--{foreach from=$arrPRODUCTLISTMAX item="dispnum" key="num"}-->
194                        <!--{if $num == $disp_number}-->
195                        <option value="<!--{$num}-->" selected="selected" ><!--{$dispnum}--></option>
196                        <!--{else}-->
197                        <option value="<!--{$num}-->" ><!--{$dispnum}--></option>
198                        <!--{/if}-->
199                    <!--{/foreach}-->
200                </select>
201            </div>
202            <div class="navi"><!--{$tpl_strnavi}--></div>
203        </div>
204    <!--{/capture}-->
205    <!--▲ページナビ(本文)-->
206
207    <!--{foreach from=$arrProducts item=arrProduct name=arrProducts}-->
208
209        <!--{if $smarty.foreach.arrProducts.first}-->
210            <!--▼件数-->
211            <div>
212                <span class="pagenumber"><!--{$tpl_linemax}--></span>件の商品がございます。
213            </div>
214            <!--▲件数-->
215           
216            <!--▼ページナビ(上部)-->
217            <form name="page_navi_top" id="page_navi_top" action="?">
218                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
219            </form>
220            <!--▲ページナビ(上部)-->
221        <!--{/if}-->
222
223        <!--{assign var=id value=$arrProduct.product_id}-->
224        <!--{assign var=arrErr value=$arrProduct.arrErr}-->
225        <!--▼商品-->
226        <div class="listarea">
227        <a name="product<!--{$id|h}-->" />
228            <div class="listphoto">
229                <!--★画像★-->
230                <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>
231            </div>
232           
233            <div class="listrightblock">
234                <!--▼商品ステータス-->
235                <!--{if count($productStatus[$id]) > 0}-->
236                    <ul class="status_icon">
237                        <!--{foreach from=$productStatus[$id] item=status}-->
238                            <li>
239                                <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->"/>
240                            </li>
241                        <!--{/foreach}-->
242                    </ul>
243                <!--{/if}-->
244                <!--▲商品ステータス-->
245               
246                <!--★商品名★-->
247                <h3>
248                    <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" name="product<!--{$arrProduct.product_id}-->"><!--{$arrProduct.name|h}--></a>
249                </h3>
250               
251                <!--★コメント★-->
252                <p class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></p>
253               
254                <p>
255                    <span class="pricebox sale_price">
256                        <!--{$smarty.const.SALE_PRICE_TITLE}--><span class="mini">(税込)</span>:
257                        <span class="price">
258                            <span id="price02_default_<!--{$id}-->">
259                                <!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
260                                    <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
261                                <!--{else}-->
262                                    <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
263                                <!--{/if}-->
264                            </span><span id="price02_dynamic_<!--{$id}-->"></span>
265                            円</span>
266                    </span>
267                   
268                    <!--★詳細ボタン★-->
269                    <span class="btnbox">
270                        <!--{assign var=name value="detail`$id`"}-->
271                        <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail_on.gif','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail.gif','<!--{$name}-->');">
272                            <img src="<!--{$TPL_URLPATH}-->img/button/btn_detail.gif" width="115" height="25" alt="詳しくはこちら" name="<!--{$name}-->" id="<!--{$name}-->" /></a>
273                    </span>
274                </p>
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                    <div class="in_cart">
282                        <!--{if $tpl_stock_find[$id]}-->
283                            <dl>
284                                <!--{if $tpl_classcat_find1[$id]}-->
285                                    <!--▼規格1-->
286                                    <dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
287                                    <dd>
288                                        <select name="classcategory_id1"
289                                            style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->"
290                                            onchange="fnSetClassCategories(this.form);"
291                                        >
292                                            <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}-->
293                                        </select>
294                                        <!--{if $arrErr.classcategory_id1 != ""}-->
295                                            <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span>
296                                        <!--{/if}-->
297                                    </dd>
298                                    <!--▲規格1-->
299                                <!--{/if}-->
300                                <!--{if $tpl_classcat_find2[$id]}-->
301                                    <!--▼規格2-->
302                                    <dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
303                                    <dd>
304                                        <select name="classcategory_id2"
305                                            style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->"
306                                            onchange="fnCheckStock(this.form);"
307                                        >
308                                        </select>
309                                        <!--{if $arrErr.classcategory_id2 != ""}-->
310                                            <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span>
311                                        <!--{/if}-->
312                                    </dd>
313                                    <!--▲規格2-->
314                                <!--{/if}-->
315
316                                <dt>数量:</dt>
317                                <dd>
318                                    <input type="text" name="quantity" class="box54" value="<!--{$arrProduct.quantity|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
319                                    <!--{if $arrErr.quantity != ""}-->
320                                        <br /><span class="attention"><!--{$arrErr.quantity}--></span>
321                                    <!--{/if}-->
322                                </dd>
323                            </dl>
324                            <div class="cartbtn">
325                                <!--★カゴに入れる★-->
326                                <div id="cartbtn_default_<!--{$id}-->">
327                                    <input
328                                        type="image"
329                                        id="cart<!--{$id}-->"
330                                        src="<!--{$TPL_URLPATH}-->img/button/btn_cartin.gif"
331                                        alt="カゴに入れる"
332                                        onclick="fnInCart(this.form); return false;"
333                                        onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin_on.gif', this);"
334                                        onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin.gif', this);"
335                                    />
336                                </div>
337                                <div class="attention" id="cartbtn_dynamic_<!--{$id}-->"></div>
338                            </div>
339                        <!--{else}-->
340                            <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div>
341                        <!--{/if}-->
342                    </div>
343                </form>
344                <!--▲買い物かご-->
345               
346            </div>
347        </div>
348        <!--▲商品-->
349
350        <!--{if $smarty.foreach.arrProducts.last}-->
351            <!--▼ページナビ(下部)-->
352            <form name="page_navi_bottom" id="page_navi_bottom" action="?">
353                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
354            </form>
355            <!--▲ページナビ(下部)-->
356        <!--{/if}-->
357
358    <!--{foreachelse}-->
359        <!--{include file="frontparts/search_zero.tpl"}-->
360    <!--{/foreach}-->
361
362</div>
363<!--▲CONTENTS-->
Note: See TracBrowser for help on using the repository browser.