source: branches/version-2_12-dev/data/Smarty/templates/sphone/products/list.tpl @ 21866

Revision 21866, 10.6 KB checked in by h_yoshimoto, 12 years ago (diff)

#1831 Copyrightを更新を誤っているので戻します

  • 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-2011 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" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script>
24<script type="text/javascript">//<![CDATA[
25    // 並び順を変更
26    function fnChangeOrderby(orderby) {
27        fnSetVal('orderby', orderby);
28        fnSetVal('pageno', 1);
29        fnSubmit();
30    }
31    // 表示件数を変更
32    function fnChangeDispNumber(dispNumber) {
33        fnSetVal('disp_number', dispNumber);
34        fnSetVal('pageno', 1);
35        fnSubmit();
36    }
37//]]></script>
38
39<section id="product_list">
40    <form name="form1" id="form1" method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php">
41        <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
42        <input type="hidden" name="mode" value="<!--{$mode|h}-->" />
43        <input type="hidden" name="category_id" value="<!--{$arrSearchData.category_id|h}-->" />
44        <input type="hidden" name="maker_id" value="<!--{$arrSearchData.maker_id|h}-->" />
45        <input type="hidden" name="name" value="<!--{$arrSearchData.name|h}-->" />
46        <input type="hidden" name="orderby" value="<!--{$orderby|h}-->" />
47        <input type="hidden" name="disp_number" value="<!--{$disp_number|h}-->" />
48        <input type="hidden" name="pageno" value="<!--{$tpl_pageno|h}-->" />
49        <input type="hidden" name="product_id" value="" />
50        <input type="hidden" name="classcategory_id1" value="" />
51        <input type="hidden" name="classcategory_id2" value="" />
52        <input type="hidden" name="product_class_id" value="" />
53        <input type="hidden" name="quantity" value="" />
54        <input type="hidden" name="rnd" value="<!--{$tpl_rnd|h}-->" />
55    </form>
56
57    <h2 class="title"><!--{$tpl_subtitle|h}--></h2>
58    <p class="intro clear"><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>の商品がございます。</p>
59
60    <!--▼ページナビ(本文)-->
61    <section class="pagenumberarea clearfix">
62        <ul>
63            <!--{if $orderby != 'price'}-->
64                <li><a href="javascript:fnChangeOrderby('price');" rel="external">価格順</a></li>
65            <!--{else}-->
66                <li class="on_number">価格順</li>
67            <!--{/if}-->
68            <!--{if $orderby != "date"}-->
69                <li><a href="javascript:fnChangeOrderby('date');" rel="external">新着順</a></li>
70            <!--{else}-->
71                <li class="on_number">新着順</li>
72            <!--{/if}-->
73        </ul>
74    </section>
75    <!--▲ページナビ(本文)-->
76
77    <!--{foreach from=$arrProducts item=arrProduct name=arrProducts}-->
78        <!--{assign var=id value=$arrProduct.product_id}-->
79        <!--{assign var=arrErr value=$arrProduct.arrErr}-->
80        <!--▼商品-->
81        <div class="list_area clearfix">
82            <!--★画像★-->
83            <p class="listphoto"><img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrProduct.main_list_image|sfNoImageMainList|h}-->&amp;width=80&amp;height=80"  alt="<!--{$arrProduct.name|h}-->" /></p>
84
85            <div class="listrightblock">
86                <div class="statusArea">
87                    <!--▼商品ステータス-->
88                    <!--{if count($productStatus[$id]) > 0}-->
89                        <ul class="status_icon">
90                            <!--{foreach from=$productStatus[$id] item=status}-->
91                                <li><!--{$arrSTATUS[$status]}--></li>
92                            <!--{/foreach}-->
93                        </ul>
94                    <!--{/if}-->
95                    <!--▲商品ステータス-->
96                </div>
97                <!--★商品名★-->
98                <h3><a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$arrProduct.product_id|u}-->" name="product<!--{$arrProduct.product_id}-->" class="productName"><!--{$arrProduct.name|h}--></a></h3>
99
100                <!--★商品価格★-->
101                <p>
102                    <span class="pricebox sale_price"><span class="mini">販売価格(税込):</span></span>
103                    <span class="price">
104                        <span id="price02_default_<!--{$id}-->">
105                            <!--{if $arrProduct.price02_min_inctax == $arrProduct.price02_max_inctax}-->
106                                <!--{$arrProduct.price02_min_inctax|number_format}-->
107                            <!--{else}-->
108                                <!--{$arrProduct.price02_min_inctax|number_format}-->~<!--{$arrProduct.price02_max_inctax|number_format}-->
109                            <!--{/if}-->
110                        </span><span id="price02_dynamic_<!--{$id}-->">
111                        </span>円
112                    </span>
113                </p>
114
115                <!--★商品コメント★-->
116                <p class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></p>
117            </div>
118        </div>
119        <!--▲商品-->
120
121    <!--{foreachelse}-->
122        <!--{include file="frontparts/search_zero.tpl"}-->
123    <!--{/foreach}-->
124
125    <!--{if count($arrProducts) < $tpl_linemax}-->
126        <div class="btn_area">
127            <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_product" onClick="getProducts(<!--{$disp_number|h}-->); return false;">もっとみる(+<!--{$disp_number|h}-->件)</a></p>
128        </div>
129    <!--{/if}-->
130</section>
131
132<!--▼検索バー -->
133<section id="search_area">
134    <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php">
135        <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
136        <input type="hidden" name="mode" value="search" />
137        <input type="search" name="name" id="search" value="" placeholder="キーワードを入力" class="searchbox" >
138    </form>
139</section>
140<!--▲検索バー -->
141
142<script>
143    var pageNo = 2;
144    var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->";
145    var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/";
146    var statusImagePath = "<!--{$TPL_URLPATH}-->";
147
148    function getProducts(limit) {
149        $.mobile.showPageLoadingMsg();
150        var i = limit;
151        //送信データを準備
152        var postData = {};
153        $('#form1').find(':input').each(function(){
154            postData[$(this).attr('name')] = $(this).val();
155        });
156        postData["mode"] = "json";
157        postData["pageno"] = pageNo;
158
159        $.ajax({
160            type: "POST",
161            data: postData,
162            url: "<!--{$smarty.const.ROOT_URLPATH}-->products/list.php",
163            cache: false,
164            dataType: "json",
165            error: function(XMLHttpRequest, textStatus, errorThrown){
166                alert(textStatus);
167                $.mobile.hidePageLoadingMsg();
168            },
169            success: function(result){
170                var productStatus = result.productStatus;
171                for (var product_id in result) {
172                    if (isNaN(product_id)) continue;
173                    var product = result[product_id];
174                    var productHtml = "";
175                    var maxCnt = $(".list_area").length - 1;
176                    var productEl = $(".list_area").get(maxCnt);
177                    productEl = $(productEl).clone(true).insertAfter(productEl);
178                    maxCnt++;
179
180                    //商品写真をセット
181                    $($(".list_area .listphoto img").get(maxCnt)).attr({
182                        src: "<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=" + product.main_list_image + '&width=80&height=80',
183                        alt: product.name
184                    });
185
186                    // 商品ステータスをセット
187                    var statusAreaEl = $($(".list_area div.statusArea").get(maxCnt));
188                    // 商品ステータスの削除
189                    statusAreaEl.empty();
190
191                    if (productStatus[product.product_id] != null) {
192                        var statusEl = '<ul class="status_icon">';
193                        var statusCnt = productStatus[product.product_id].length;
194                        for (var k = 0; k < statusCnt; k++) {
195                            var status = productStatus[product.product_id][k];
196                            var statusImgEl = '<li>' + status.status_name + '</li>' + "\n";
197                            statusEl += statusImgEl;
198                        }
199                        statusEl += "</ul>";
200                        statusAreaEl.append(statusEl);
201                    }
202
203                    //商品名をセット
204                    $($(".list_area a.productName").get(maxCnt)).text(product.name);
205                    $($(".list_area a.productName").get(maxCnt)).attr("href", url + product.product_id);
206
207                    //販売価格をセット
208                    var price = $($(".list_area span.price").get(maxCnt));
209                    //販売価格をクリア
210                    price.empty();
211                    var priceVale = "";
212                    //販売価格が範囲か判定
213                    if (product.price02_min == product.price02_max) {
214                        priceVale = product.price02_min_tax_format + '円';
215                    } else {
216                        priceVale = product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円';
217                    }
218                    price.append(priceVale);
219
220                    //コメントをセット
221                    $($(".list_area .listcomment").get(maxCnt)).text(product.main_list_comment);
222                }
223                pageNo++;
224
225                //すべての商品を表示したか判定
226                if (parseInt($("#productscount").text()) <= $(".list_area").length) {
227                    $("#btn_more_product").hide();
228                }
229                $.mobile.hidePageLoadingMsg();
230            }
231        });
232    }
233</script>
Note: See TracBrowser for help on using the repository browser.