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

Revision 23063, 14.5 KB checked in by pineray, 11 years ago (diff)

#2342 JavaScript?のグローバルな宣言を減らす
フォーム関連.

  • 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-2013 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
23<script type="text/javascript">//<![CDATA[
24    function fnSetClassCategories(form, classcat_id2_selected) {
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);
30    }
31    // 並び順を変更
32    function fnChangeOrderby(orderby) {
33        eccube.common.setValue('orderby', orderby);
34        eccube.common.setValue('pageno', 1);
35        fnSubmit();
36    }
37    // 表示件数を変更
38    function fnChangeDispNumber(dispNumber) {
39        eccube.common.setValue('disp_number', dispNumber);
40        eccube.common.setValue('pageno', 1);
41        fnSubmit();
42    }
43    // カゴに入れる
44    function fnInCart(productForm) {
45        var searchForm = $("#form1");
46        var cartForm = $(productForm);
47        // 検索条件を引き継ぐ
48        var hiddenValues = ['mode','category_id','maker_id','name','orderby','disp_number','pageno','rnd'];
49        $.each(hiddenValues, function(){
50            // 商品別のフォームに検索条件の値があれば上書き
51            if (cartForm.has('input[name='+this+']').length != 0) {
52                cartForm.find('input[name='+this+']').val(searchForm.find('input[name='+this+']').val());
53            }
54            // なければ追加
55            else {
56                cartForm.append($('<input type="hidden" />').attr("name", this).val(searchForm.find('input[name='+this+']').val()));
57            }
58        });
59        // 商品別のフォームを送信
60        cartForm.submit();
61    }
62//]]></script>
63
64<div id="undercolumn">
65    <form name="form1" id="form1" method="get" action="?">
66        <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
67        <input type="hidden" name="mode" value="<!--{$mode|h}-->" />
68        <!--{* ▼検索条件 *}-->
69        <input type="hidden" name="category_id" value="<!--{$arrSearchData.category_id|h}-->" />
70        <input type="hidden" name="maker_id" value="<!--{$arrSearchData.maker_id|h}-->" />
71        <input type="hidden" name="name" value="<!--{$arrSearchData.name|h}-->" />
72        <!--{* ▲検索条件 *}-->
73        <!--{* ▼ページナビ関連 *}-->
74        <input type="hidden" name="orderby" value="<!--{$orderby|h}-->" />
75        <input type="hidden" name="disp_number" value="<!--{$disp_number|h}-->" />
76        <input type="hidden" name="pageno" value="<!--{$tpl_pageno|h}-->" />
77        <!--{* ▲ページナビ関連 *}-->
78        <input type="hidden" name="rnd" value="<!--{$tpl_rnd|h}-->" />
79    </form>
80
81    <!--★タイトル★-->
82    <h2 class="title"><!--{$tpl_subtitle|h}--></h2>
83
84    <!--▼検索条件-->
85    <!--{if $tpl_subtitle == "検索結果"}-->
86        <ul class="pagecond_area">
87            <li><strong>商品カテゴリ:</strong><!--{$arrSearch.category|h}--></li>
88        <!--{if $arrSearch.maker|strlen >= 1}--><li><strong>メーカー:</strong><!--{$arrSearch.maker|h}--></li><!--{/if}-->
89            <li><strong>商品名:</strong><!--{$arrSearch.name|h}--></li>
90        </ul>
91    <!--{/if}-->
92    <!--▲検索条件-->
93
94    <!--▼ページナビ(本文)-->
95    <!--{capture name=page_navi_body}-->
96        <div class="pagenumber_area clearfix">
97            <div class="change">
98                <!--{if $orderby != 'price'}-->
99                    <a href="javascript:fnChangeOrderby('price');">価格順</a>
100                <!--{else}-->
101                    <strong>価格順</strong>
102                <!--{/if}-->&nbsp;
103                <!--{if $orderby != "date"}-->
104                        <a href="javascript:fnChangeOrderby('date');">新着順</a>
105                <!--{else}-->
106                    <strong>新着順</strong>
107                <!--{/if}-->
108                表示件数
109                <select name="disp_number" onchange="javascript:fnChangeDispNumber(this.value);">
110                    <!--{foreach from=$arrPRODUCTLISTMAX item="dispnum" key="num"}-->
111                        <!--{if $num == $disp_number}-->
112                            <option value="<!--{$num}-->" selected="selected" ><!--{$dispnum}--></option>
113                        <!--{else}-->
114                            <option value="<!--{$num}-->" ><!--{$dispnum}--></option>
115                        <!--{/if}-->
116                    <!--{/foreach}-->
117                </select>
118            </div>
119            <div class="navi"><!--{$tpl_strnavi}--></div>
120        </div>
121    <!--{/capture}-->
122    <!--▲ページナビ(本文)-->
123
124    <!--{foreach from=$arrProducts item=arrProduct name=arrProducts}-->
125
126        <!--{if $smarty.foreach.arrProducts.first}-->
127            <!--▼件数-->
128            <div>
129                <span class="attention"><!--{$tpl_linemax}-->件</span>の商品がございます。
130            </div>
131            <!--▲件数-->
132
133            <!--▼ページナビ(上部)-->
134            <form name="page_navi_top" id="page_navi_top" action="?">
135                <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
136                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
137            </form>
138            <!--▲ページナビ(上部)-->
139        <!--{/if}-->
140
141        <!--{assign var=id value=$arrProduct.product_id}-->
142        <!--{assign var=arrErr value=$arrProduct.arrErr}-->
143        <!--▼商品-->
144        <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;">
145            <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
146            <input type="hidden" name="product_id" value="<!--{$id|h}-->" />
147            <input type="hidden" name="product_class_id" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" />
148            <div class="list_area clearfix">
149                <a name="product<!--{$id|h}-->"></a>
150                <div class="listphoto">
151                    <!--★画像★-->
152                    <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->">
153                        <img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->" alt="<!--{$arrProduct.name|h}-->" class="picture" /></a>
154                </div>
155
156                <div class="listrightbloc">
157                    <!--▼商品ステータス-->
158                    <!--{if count($productStatus[$id]) > 0}-->
159                        <ul class="status_icon clearfix">
160                            <!--{foreach from=$productStatus[$id] item=status}-->
161                                <li>
162                                    <img src="<!--{$TPL_URLPATH}--><!--{$arrSTATUS_IMAGE[$status]}-->" width="60" height="17" alt="<!--{$arrSTATUS[$status]}-->"/>
163                                </li>
164                            <!--{/foreach}-->
165                        </ul>
166                    <!--{/if}-->
167                    <!--▲商品ステータス-->
168
169                    <!--★商品名★-->
170                    <h3>
171                        <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->"><!--{$arrProduct.name|h}--></a>
172                    </h3>
173                    <!--★価格★-->
174                    <div class="pricebox sale_price">
175                        <!--{$smarty.const.SALE_PRICE_TITLE}-->(税込):
176                        <span class="price">
177                            <span id="price02_default_<!--{$id}-->"><!--{strip}-->
178                                <!--{if $arrProduct.price02_min_inctax == $arrProduct.price02_max_inctax}-->
179                                    <!--{$arrProduct.price02_min_inctax|number_format}-->
180                                <!--{else}-->
181                                    <!--{$arrProduct.price02_min_inctax|number_format}-->~<!--{$arrProduct.price02_max_inctax|number_format}-->
182                                <!--{/if}-->
183                            </span><span id="price02_dynamic_<!--{$id}-->"></span><!--{/strip}-->
184                            円</span>
185                    </div>
186
187                    <!--★コメント★-->
188                    <div class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></div>
189
190                    <!--★商品詳細を見る★-->
191                    <div class="detail_btn">
192                        <!--{assign var=name value="detail`$id`"}-->
193                        <a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" onmouseover="eccube.common.chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail_on.jpg','<!--{$name}-->');" onmouseout="eccube.common.chgImg('<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg','<!--{$name}-->');">
194                        <img src="<!--{$TPL_URLPATH}-->img/button/btn_detail.jpg" alt="商品詳細を見る" name="<!--{$name}-->" id="<!--{$name}-->" /></a>
195                    </div>
196
197                    <!--▼買い物かご-->
198                    <div class="cart_area clearfix">
199                        <!--{if $tpl_stock_find[$id]}-->
200                            <!--{if $tpl_classcat_find1[$id]}-->
201                                <div class="classlist">
202                                    <dl class="size01 clearfix">
203                                            <!--▼規格1-->
204                                            <dt><!--{$tpl_class_name1[$id]|h}-->:</dt>
205                                            <dd>
206                                                <select name="classcategory_id1" style="<!--{$arrErr.classcategory_id1|sfGetErrorColor}-->">
207                                                    <!--{html_options options=$arrClassCat1[$id] selected=$arrProduct.classcategory_id1}-->
208                                                </select>
209                                                <!--{if $arrErr.classcategory_id1 != ""}-->
210                                                    <p class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</p>
211                                                <!--{/if}-->
212                                            </dd>
213                                            <!--▲規格1-->
214                                    </dl>
215                                    <!--{if $tpl_classcat_find2[$id]}-->
216                                        <dl class="size02 clearfix">
217                                            <!--▼規格2-->
218                                            <dt><!--{$tpl_class_name2[$id]|h}-->:</dt>
219                                            <dd>
220                                                <select name="classcategory_id2" style="<!--{$arrErr.classcategory_id2|sfGetErrorColor}-->">
221                                                </select>
222                                                <!--{if $arrErr.classcategory_id2 != ""}-->
223                                                    <p class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</p>
224                                                <!--{/if}-->
225                                            </dd>
226                                            <!--▲規格2-->
227                                        </dl>
228                                    <!--{/if}-->
229                                </div>
230                            <!--{/if}-->
231                            <div class="cartin clearfix">
232                                <div class="quantity">
233                                    数量:<input type="text" name="quantity" class="box" value="<!--{$arrProduct.quantity|default:1|h}-->" maxlength="<!--{$smarty.const.INT_LEN}-->" style="<!--{$arrErr.quantity|sfGetErrorColor}-->" />
234                                    <!--{if $arrErr.quantity != ""}-->
235                                        <br /><span class="attention"><!--{$arrErr.quantity}--></span>
236                                    <!--{/if}-->
237                                </div>
238                                <div class="cartin_btn">
239                                    <!--★カゴに入れる★-->
240                                    <div id="cartbtn_default_<!--{$id}-->">
241                                        <input type="image" id="cart<!--{$id}-->" src="<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg" alt="カゴに入れる" onclick="fnInCart(this.form); return false;" onmouseover="eccube.common.chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin_on.jpg', this);" onmouseout="eccube.common.chgImg('<!--{$TPL_URLPATH}-->img/button/btn_cartin.jpg', this);" />
242                                    </div>
243                                    <div class="attention" id="cartbtn_dynamic_<!--{$id}-->"></div>
244                                </div>
245                            </div>
246                        <!--{else}-->
247                            <div class="cartbtn attention">申し訳ございませんが、只今品切れ中です。</div>
248                        <!--{/if}-->
249                    </div>
250                    <!--▲買い物かご-->
251                </div>
252            </div>
253        </form>
254        <!--▲商品-->
255
256        <!--{if $smarty.foreach.arrProducts.last}-->
257            <!--▼ページナビ(下部)-->
258            <form name="page_navi_bottom" id="page_navi_bottom" action="?">
259                <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
260                <!--{if $tpl_linemax > 0}--><!--{$smarty.capture.page_navi_body|smarty:nodefaults}--><!--{/if}-->
261            </form>
262            <!--▲ページナビ(下部)-->
263        <!--{/if}-->
264
265    <!--{foreachelse}-->
266        <!--{include file="frontparts/search_zero.tpl"}-->
267    <!--{/foreach}-->
268
269</div>
Note: See TracBrowser for help on using the repository browser.