source: branches/version-2_12-multilang/data/Smarty/templates/sphone_en/products/list.tpl @ 22210

Revision 22210, 10.3 KB checked in by m_uehara, 11 years ago (diff)

#1991 & を $ に修正しました。

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