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

Revision 20116, 17.2 KB checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • 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                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    }
51}
52// 並び順を変更
53function fnChangeOrderby(orderby) {
54    fnSetVal('orderby', orderby);
55    fnSetVal('pageno', 1);
56    fnSubmit();
57}
58// 表示件数を変更
59function fnChangeDispNumber(dispNumber) {
60    fnSetVal('disp_number', dispNumber);
61    fnSetVal('pageno', 1);
62    fnSubmit();
63}
64// カゴに入れる
65function fnInCart(productForm) {
66    var product_id = productForm["product_id"].value;
67    fnChangeAction("?#product" + product_id);
68    if (productForm["classcategory_id1"]) {
69        fnSetVal("classcategory_id1", productForm["classcategory_id1"].value);
70    }
71    if (productForm["classcategory_id2"]) {
72        fnSetVal("classcategory_id2", productForm["classcategory_id2"].value);
73    }
74    fnSetVal("quantity", productForm["quantity"].value);
75    fnSetVal("product_id", productForm["product_id"].value);
76    fnSetVal("product_class_id", productForm["product_class_id"].value);
77    fnSetVal("product_type", productForm["product_type"].value);
78    fnSubmit();
79}
80function 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           classcat2
91        && classcat2.stock_find === false
92    ) {
93        eleDefault.style.display = 'none';
94        eleDynamic.innerHTML = '申し訳ございませんが、只今品切れ中です。';
95    } else {
96        eleDefault.style.display = '';
97        eleDynamic.innerHTML = '';
98    }
99   
100    // 販売価格
101    eleDefault = document.getElementById('price02_default_' + product_id);
102    eleDynamic = document.getElementById('price02_dynamic_' + product_id);
103    if (
104           classcat2
105        && typeof classcat2.price02 != 'undefined'
106        && String(classcat2.price02).length >= 1
107    ) {
108        eleDefault.style.display = 'none';
109        eleDynamic.innerHTML = classcat2.price02;
110    } else {
111        eleDefault.style.display = '';
112        eleDynamic.innerHTML = '';
113    }
114    // 商品規格
115    eleDynamic = document.getElementById('product_class_id' + product_id);
116    if (
117           classcat2
118        && typeof classcat2.product_class_id != 'undefined'
119        && String(classcat2.product_class_id).length >= 1
120    ) {
121        eleDynamic.value = classcat2.product_class_id;
122    } else {
123        eleDynamic.value = ''
124    }
125    // 商品種別
126    eleDynamic = document.getElementById('product_type' + product_id);
127    if (
128           classcat2
129        && typeof classcat2.product_type != 'undefined'
130        && String(classcat2.product_type).length >= 1
131    ) {
132        eleDynamic.value = classcat2.product_type;
133    } else {
134        eleDynamic.value = ''
135    }
136}
137//]]>
138</script>
139
140<!--▼CONTENTS-->
141<div id="undercolumn" class="product product_list">
142    <form name="form1" id="form1" method="get" action="?">
143        <input type="hidden" name="mode" value="<!--{$mode|h}-->" />
144        <!--{* ▼検索条件 *}-->
145        <input type="hidden" name="category_id" value="<!--{$arrSearchData.category_id|h}-->" />
146        <input type="hidden" name="maker_id" value="<!--{$arrSearchData.maker_id|h}-->" />
147        <input type="hidden" name="name" value="<!--{$arrSearchData.name|h}-->" />
148        <!--{* ▲検索条件 *}-->
149        <!--{* ▼ページナビ関連 *}-->
150        <input type="hidden" name="orderby" value="<!--{$orderby|h}-->" />
151        <input type="hidden" name="disp_number" value="<!--{$disp_number|h}-->" />
152        <input type="hidden" name="pageno" value="<!--{$tpl_pageno|h}-->" />
153        <!--{* ▲ページナビ関連 *}-->
154        <!--{* ▼注文関連 *}-->
155        <input type="hidden" name="product_id" value="" />
156        <input type="hidden" name="classcategory_id1" value="" />
157        <input type="hidden" name="classcategory_id2" value="" />
158        <input type="hidden" name="product_class_id" value="" />
159        <input type="hidden" name="product_type" value="" />
160        <input type="hidden" name="quantity" value="" />
161        <!--{* ▲注文関連 *}-->
162        <input type="hidden" name="rnd" value="<!--{$tpl_rnd|h}-->" />
163    </form>
164   
165    <!--★タイトル★-->
166    <h2 class="title"><!--{$tpl_subtitle|h}--></h2>
167   
168    <!--▼検索条件-->
169    <!--{if $tpl_subtitle == "検索結果"}-->
170        <ul class="pagecondarea">
171            <li><strong>商品カテゴリ:</strong><!--{$arrSearch.category|h}--></li>
172        <!--{if $arrSearch.maker|strlen >= 1}--><li><strong>メーカー:</strong><!--{$arrSearch.maker|h}--></li><!--{/if}-->
173            <li><strong>商品名:</strong><!--{$arrSearch.name|h}--></li>
174        </ul>
175    <!--{/if}-->
176    <!--▲検索条件-->
177
178    <!--▼ページナビ(本文)-->
179    <!--{capture name=page_navi_body}-->
180        <div class="pagenumberarea">
181            <div class="change">
182                <!--{if $orderby != 'price'}-->
183                    <a href="javascript:fnChangeOrderby('price');">価格順</a>
184                <!--{else}-->
185                    <strong>価格順</strong>
186                <!--{/if}-->&nbsp;
187                <!--{if $orderby != "date"}-->
188                        <a href="javascript:fnChangeOrderby('date');">新着順</a>
189                <!--{else}-->
190                    <strong>新着順</strong>
191                <!--{/if}-->
192                表示件数
193                <select name="disp_number" onchange="javascript:fnChangeDispNumber(this.value);">
194                    <!--{foreach from=$arrPRODUCTLISTMAX item="dispnum" key="num"}-->
195                        <!--{if $num == $disp_number}-->
196                        <option value="<!--{$num}-->" selected="selected" ><!--{$dispnum}--></option>
197                        <!--{else}-->
198                        <option value="<!--{$num}-->" ><!--{$dispnum}--></option>
199                        <!--{/if}-->
200                    <!--{/foreach}-->
201                </select>
202            </div>
203            <div class="navi"><!--{$tpl_strnavi}--></div>
204        </div>
205    <!--{/capture}-->
206    <!--▲ページナビ(本文)-->
207
208    <!--{foreach from=$arrProducts item=arrProduct name=arrProducts}-->
209
210        <!--{if $smarty.foreach.arrProducts.first}-->
211            <!--▼件数-->
212            <div>
213                <span class="pagenumber"><!--{$tpl_linemax}--></span>件の商品がございます。
214            </div>
215            <!--▲件数-->
216           
217            <!--▼ページナビ(上部)-->
218            <form name="page_navi_top" id="page_navi_top" action="?">
219                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
220            </form>
221            <!--▲ページナビ(上部)-->
222        <!--{/if}-->
223
224        <!--{assign var=id value=$arrProduct.product_id}-->
225        <!--{assign var=arrErr value=$arrProduct.arrErr}-->
226        <!--▼商品-->
227        <div class="listarea">
228        <a name="product<!--{$id|h}-->" />
229            <div class="listphoto">
230                <!--★画像★-->
231                <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>
232            </div>
233           
234            <div class="listrightblock">
235                <!--▼商品ステータス-->
236                <!--{if count($productStatus[$id]) > 0}-->
237                    <ul class="status_icon">
238                        <!--{foreach from=$productStatus[$id] item=status}-->
239                            <li>
240                                <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->"/>
241                            </li>
242                        <!--{/foreach}-->
243                    </ul>
244                <!--{/if}-->
245                <!--▲商品ステータス-->
246               
247                <!--★商品名★-->
248                <h3>
249                    <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" name="product<!--{$arrProduct.product_id}-->"><!--{$arrProduct.name|h}--></a>
250                </h3>
251               
252                <!--★コメント★-->
253                <p class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></p>
254               
255                <p>
256                    <span class="pricebox sale_price">
257                        <!--{$smarty.const.SALE_PRICE_TITLE}--><span class="mini">(税込)</span>:
258                        <span class="price">
259                            <span id="price02_default_<!--{$id}-->">
260                                <!--{if $arrProduct.price02_min == $arrProduct.price02_max}-->
261                                    <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
262                                <!--{else}-->
263                                    <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->
264                                <!--{/if}-->
265                            </span><span id="price02_dynamic_<!--{$id}-->"></span>
266                            円</span>
267                    </span>
268                   
269                    <!--★詳細ボタン★-->
270                    <span class="btnbox">
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.gif','<!--{$name}-->');" onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail.gif','<!--{$name}-->');">
273                            <img src="<!--{$TPL_URLPATH}-->img/button/btn_detail.gif" width="115" height="25" alt="詳しくはこちら" name="<!--{$name}-->" id="<!--{$name}-->" /></a>
274                    </span>
275                </p>
276
277                <!--▼買い物かご-->
278                <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;">
279                    <input type="hidden" name="product_id" value="<!--{$id|h}-->" />
280                    <input type="hidden" name="product_class_id" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" />
281                    <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" />
282                    <div class="in_cart">
283                        <!--{if $tpl_stock_find[$id]}-->
284                            <dl>
285                                <!--{if $tpl_classcat_find1[$id]}-->
286                                    <!--▼規格1-->
287                                    <dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
288                                    <dd>
289                                        <select name="classcategory_id1"
290                                            style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->"
291                                            onchange="fnSetClassCategories(this.form);"
292                                        >
293                                            <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}-->
294                                        </select>
295                                        <!--{if $arrErr.classcategory_id1 != ""}-->
296                                            <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span>
297                                        <!--{/if}-->
298                                    </dd>
299                                    <!--▲規格1-->
300                                <!--{/if}-->
301                                <!--{if $tpl_classcat_find2[$id]}-->
302                                    <!--▼規格2-->
303                                    <dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
304                                    <dd>
305                                        <select name="classcategory_id2"
306                                            style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->"
307                                            onchange="fnCheckStock(this.form);"
308                                        >
309                                        </select>
310                                        <!--{if $arrErr.classcategory_id2 != ""}-->
311                                            <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span>
312                                        <!--{/if}-->
313                                    </dd>
314                                    <!--▲規格2-->
315                                <!--{/if}-->
316
317                                <dt>数量:</dt>
318                                <dd>
319                                    <input type="text" name="quantity" class="box54" value="<!--{$arrProduct.quantity|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
320                                    <!--{if $arrErr.quantity != ""}-->
321                                        <br /><span class="attention"><!--{$arrErr.quantity}--></span>
322                                    <!--{/if}-->
323                                </dd>
324                            </dl>
325                            <div class="cartbtn">
326                                <!--★カゴに入れる★-->
327                                <div id="cartbtn_default_<!--{$id}-->">
328                                    <input
329                                        type="image"
330                                        id="cart<!--{$id}-->"
331                                        src="<!--{$TPL_URLPATH}-->img/button/btn_cartin.gif"
332                                        alt="カゴに入れる"
333                                        onclick="fnInCart(this.form); return false;"
334                                        onmouseover="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin_on.gif', this);"
335                                        onmouseout="chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin.gif', this);"
336                                    />
337                                </div>
338                                <div class="attention" id="cartbtn_dynamic_<!--{$id}-->"></div>
339                            </div>
340                        <!--{else}-->
341                            <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div>
342                        <!--{/if}-->
343                    </div>
344                </form>
345                <!--▲買い物かご-->
346               
347            </div>
348        </div>
349        <!--▲商品-->
350
351        <!--{if $smarty.foreach.arrProducts.last}-->
352            <!--▼ページナビ(下部)-->
353            <form name="page_navi_bottom" id="page_navi_bottom" action="?">
354                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
355            </form>
356            <!--▲ページナビ(下部)-->
357        <!--{/if}-->
358
359    <!--{foreachelse}-->
360        <!--{include file="frontparts/search_zero.tpl"}-->
361    <!--{/foreach}-->
362
363</div>
364<!--▲CONTENTS-->
Note: See TracBrowser for help on using the repository browser.