[19661] | 1 | <!--{* |
---|
| 2 | * This file is part of EC-CUBE |
---|
| 3 | * |
---|
[22206] | 4 | * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. |
---|
[19661] | 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 | *}--> |
---|
[21533] | 22 | |
---|
[21050] | 23 | <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script> |
---|
[19661] | 24 | <script type="text/javascript">//<![CDATA[ |
---|
[21537] | 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> |
---|
[19661] | 38 | |
---|
[21050] | 39 | <section id="product_list"> |
---|
| 40 | <form name="form1" id="form1" method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
[20407] | 41 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[19785] | 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}-->" /> |
---|
[19661] | 50 | </form> |
---|
[21533] | 51 | |
---|
[19785] | 52 | <h2 class="title"><!--{$tpl_subtitle|h}--></h2> |
---|
[21533] | 53 | <p class="intro clear"><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>の商品がございます。</p> |
---|
[20540] | 54 | |
---|
[21533] | 55 | <!--▼ページナビ(本文)--> |
---|
| 56 | <section class="pagenumberarea clearfix"> |
---|
| 57 | <ul> |
---|
| 58 | <!--{if $orderby != 'price'}--> |
---|
| 59 | <li><a href="javascript:fnChangeOrderby('price');" rel="external">価格順</a></li> |
---|
| 60 | <!--{else}--> |
---|
| 61 | <li class="on_number">価格順</li> |
---|
| 62 | <!--{/if}--> |
---|
| 63 | <!--{if $orderby != "date"}--> |
---|
| 64 | <li><a href="javascript:fnChangeOrderby('date');" rel="external">新着順</a></li> |
---|
| 65 | <!--{else}--> |
---|
| 66 | <li class="on_number">新着順</li> |
---|
| 67 | <!--{/if}--> |
---|
| 68 | </ul> |
---|
| 69 | </section> |
---|
| 70 | <!--▲ページナビ(本文)--> |
---|
[19661] | 71 | |
---|
[21533] | 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}-->&width=80&height=80" alt="<!--{$arrProduct.name|h}-->" /></p> |
---|
[19661] | 79 | |
---|
[21533] | 80 | <div class="listrightblock"> |
---|
| 81 | <div class="statusArea"> |
---|
| 82 | <!--▼商品ステータス--> |
---|
| 83 | <!--{if count($productStatus[$id]) > 0}--> |
---|
| 84 | <ul class="status_icon"> |
---|
[21535] | 85 | <!--{foreach from=$productStatus[$id] item=status}--> |
---|
[21533] | 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> |
---|
[19661] | 94 | |
---|
[21533] | 95 | <!--★商品価格★--> |
---|
| 96 | <p> |
---|
[22494] | 97 | <span class="pricebox sale_price"><span class="mini"><!--{$smarty.const.SALE_PRICE_TITLE|h}-->(税込):</span></span> |
---|
[21535] | 98 | <span class="price"> |
---|
[21533] | 99 | <span id="price02_default_<!--{$id}-->"> |
---|
[21708] | 100 | <!--{if $arrProduct.price02_min_inctax == $arrProduct.price02_max_inctax}--> |
---|
| 101 | <!--{$arrProduct.price02_min_inctax|number_format}--> |
---|
| 102 | <!--{else}--> |
---|
| 103 | <!--{$arrProduct.price02_min_inctax|number_format}-->~<!--{$arrProduct.price02_max_inctax|number_format}--> |
---|
| 104 | <!--{/if}--> |
---|
[21533] | 105 | </span><span id="price02_dynamic_<!--{$id}-->"> |
---|
| 106 | </span>円 |
---|
| 107 | </span> |
---|
| 108 | </p> |
---|
| 109 | |
---|
| 110 | <!--★商品コメント★--> |
---|
| 111 | <p class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></p> |
---|
| 112 | </div> |
---|
| 113 | </div> |
---|
| 114 | <!--▲商品--> |
---|
| 115 | |
---|
| 116 | <!--{foreachelse}--> |
---|
| 117 | <!--{include file="frontparts/search_zero.tpl"}--> |
---|
| 118 | <!--{/foreach}--> |
---|
| 119 | |
---|
| 120 | <!--{if count($arrProducts) < $tpl_linemax}--> |
---|
| 121 | <div class="btn_area"> |
---|
| 122 | <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> |
---|
| 123 | </div> |
---|
| 124 | <!--{/if}--> |
---|
[21050] | 125 | </section> |
---|
[21533] | 126 | |
---|
[23002] | 127 | <!--{include file= 'frontparts/search_area.tpl'}--> |
---|
[20540] | 128 | |
---|
[21050] | 129 | <script> |
---|
[21533] | 130 | var pageNo = 2; |
---|
| 131 | var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; |
---|
[22788] | 132 | var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->"; |
---|
[21533] | 133 | var statusImagePath = "<!--{$TPL_URLPATH}-->"; |
---|
[20540] | 134 | |
---|
[21533] | 135 | function getProducts(limit) { |
---|
| 136 | $.mobile.showPageLoadingMsg(); |
---|
| 137 | var i = limit; |
---|
| 138 | //送信データを準備 |
---|
| 139 | var postData = {}; |
---|
[21535] | 140 | $('#form1').find(':input').each(function(){ |
---|
| 141 | postData[$(this).attr('name')] = $(this).val(); |
---|
[21533] | 142 | }); |
---|
| 143 | postData["mode"] = "json"; |
---|
| 144 | postData["pageno"] = pageNo; |
---|
[19661] | 145 | |
---|
[21533] | 146 | $.ajax({ |
---|
| 147 | type: "POST", |
---|
| 148 | data: postData, |
---|
| 149 | url: "<!--{$smarty.const.ROOT_URLPATH}-->products/list.php", |
---|
| 150 | cache: false, |
---|
| 151 | dataType: "json", |
---|
| 152 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
| 153 | alert(textStatus); |
---|
| 154 | $.mobile.hidePageLoadingMsg(); |
---|
| 155 | }, |
---|
| 156 | success: function(result){ |
---|
| 157 | var productStatus = result.productStatus; |
---|
[21709] | 158 | for (var product_id in result) { |
---|
| 159 | if (isNaN(product_id)) continue; |
---|
| 160 | var product = result[product_id]; |
---|
| 161 | var productHtml = ""; |
---|
| 162 | var maxCnt = $(".list_area").length - 1; |
---|
| 163 | var productEl = $(".list_area").get(maxCnt); |
---|
| 164 | productEl = $(productEl).clone(true).insertAfter(productEl); |
---|
| 165 | maxCnt++; |
---|
[19661] | 166 | |
---|
[21709] | 167 | //商品写真をセット |
---|
| 168 | $($(".list_area .listphoto img").get(maxCnt)).attr({ |
---|
| 169 | src: "<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=" + product.main_list_image + '&width=80&height=80', |
---|
| 170 | alt: product.name |
---|
| 171 | }); |
---|
[20614] | 172 | |
---|
[21709] | 173 | // 商品ステータスをセット |
---|
| 174 | var statusAreaEl = $($(".list_area div.statusArea").get(maxCnt)); |
---|
| 175 | // 商品ステータスの削除 |
---|
| 176 | statusAreaEl.empty(); |
---|
[19661] | 177 | |
---|
[21709] | 178 | if (productStatus[product.product_id] != null) { |
---|
| 179 | var statusEl = '<ul class="status_icon">'; |
---|
| 180 | var statusCnt = productStatus[product.product_id].length; |
---|
| 181 | for (var k = 0; k < statusCnt; k++) { |
---|
| 182 | var status = productStatus[product.product_id][k]; |
---|
| 183 | var statusImgEl = '<li>' + status.status_name + '</li>' + "\n"; |
---|
| 184 | statusEl += statusImgEl; |
---|
[21533] | 185 | } |
---|
[21709] | 186 | statusEl += "</ul>"; |
---|
| 187 | statusAreaEl.append(statusEl); |
---|
| 188 | } |
---|
[19661] | 189 | |
---|
[21709] | 190 | //商品名をセット |
---|
| 191 | $($(".list_area a.productName").get(maxCnt)).text(product.name); |
---|
| 192 | $($(".list_area a.productName").get(maxCnt)).attr("href", url + product.product_id); |
---|
[21533] | 193 | |
---|
[21709] | 194 | //販売価格をセット |
---|
| 195 | var price = $($(".list_area span.price").get(maxCnt)); |
---|
| 196 | //販売価格をクリア |
---|
| 197 | price.empty(); |
---|
| 198 | var priceVale = ""; |
---|
| 199 | //販売価格が範囲か判定 |
---|
| 200 | if (product.price02_min == product.price02_max) { |
---|
[22486] | 201 | priceVale = product.price02_min_inctax_format + '円'; |
---|
[21709] | 202 | } else { |
---|
[22486] | 203 | priceVale = product.price02_min_inctax_format + '~' + product.price02_max_inctax_format + '円'; |
---|
[21709] | 204 | } |
---|
| 205 | price.append(priceVale); |
---|
[21533] | 206 | |
---|
[21709] | 207 | //コメントをセット |
---|
| 208 | $($(".list_area .listcomment").get(maxCnt)).text(product.main_list_comment); |
---|
[21533] | 209 | } |
---|
| 210 | pageNo++; |
---|
| 211 | |
---|
[22960] | 212 | //全ての商品を表示したか判定 |
---|
[21533] | 213 | if (parseInt($("#productscount").text()) <= $(".list_area").length) { |
---|
| 214 | $("#btn_more_product").hide(); |
---|
| 215 | } |
---|
| 216 | $.mobile.hidePageLoadingMsg(); |
---|
| 217 | } |
---|
| 218 | }); |
---|
| 219 | } |
---|
[21172] | 220 | </script> |
---|