source: branches/version-2_13_0/data/Smarty/templates/sphone/products/list.tpl @ 23103

Revision 23103, 9.8 KB checked in by h_yoshimoto, 11 years ago (diff)

#2342 一旦戻した内容を再度適用

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