[19661] | 1 | <!--{* |
---|
| 2 | * This file is part of EC-CUBE |
---|
| 3 | * |
---|
[20764] | 4 | * Copyright(c) 2000-2011 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 | *}--> |
---|
[21050] | 22 | <script type="text/javascript" src="<!--{$smarty.const.ROOT_URLPATH}-->js/products.js"></script> |
---|
[19661] | 23 | <script type="text/javascript">//<![CDATA[ |
---|
| 24 | // 並び順を変更 |
---|
| 25 | function fnChangeOrderby(orderby) { |
---|
| 26 | fnSetVal('orderby', orderby); |
---|
| 27 | fnSetVal('pageno', 1); |
---|
| 28 | fnSubmit(); |
---|
| 29 | } |
---|
| 30 | // 表示件数を変更 |
---|
| 31 | function fnChangeDispNumber(dispNumber) { |
---|
| 32 | fnSetVal('disp_number', dispNumber); |
---|
| 33 | fnSetVal('pageno', 1); |
---|
| 34 | fnSubmit(); |
---|
| 35 | } |
---|
| 36 | //]]> |
---|
| 37 | </script> |
---|
| 38 | |
---|
| 39 | <!--▼CONTENTS--> |
---|
[21050] | 40 | <section id="product_list"> |
---|
| 41 | <form name="form1" id="form1" method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
[20407] | 42 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[19785] | 43 | <input type="hidden" name="mode" value="<!--{$mode|h}-->" /> |
---|
| 44 | <input type="hidden" name="category_id" value="<!--{$arrSearchData.category_id|h}-->" /> |
---|
| 45 | <input type="hidden" name="maker_id" value="<!--{$arrSearchData.maker_id|h}-->" /> |
---|
| 46 | <input type="hidden" name="name" value="<!--{$arrSearchData.name|h}-->" /> |
---|
| 47 | <input type="hidden" name="orderby" value="<!--{$orderby|h}-->" /> |
---|
| 48 | <input type="hidden" name="disp_number" value="<!--{$disp_number|h}-->" /> |
---|
| 49 | <input type="hidden" name="pageno" value="<!--{$tpl_pageno|h}-->" /> |
---|
[19661] | 50 | <input type="hidden" name="product_id" value="" /> |
---|
| 51 | <input type="hidden" name="classcategory_id1" value="" /> |
---|
| 52 | <input type="hidden" name="classcategory_id2" value="" /> |
---|
| 53 | <input type="hidden" name="product_class_id" value="" /> |
---|
| 54 | <input type="hidden" name="quantity" value="" /> |
---|
[19785] | 55 | <input type="hidden" name="rnd" value="<!--{$tpl_rnd|h}-->" /> |
---|
[19661] | 56 | </form> |
---|
[21050] | 57 | |
---|
[19785] | 58 | <h2 class="title"><!--{$tpl_subtitle|h}--></h2> |
---|
[21050] | 59 | <p class="intro clear"><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>の商品がございます。</p> |
---|
[20540] | 60 | |
---|
[21050] | 61 | <!--▼ページナビ(本文)--> |
---|
| 62 | <section class="pagenumberarea clearfix"> |
---|
| 63 | <ul> |
---|
| 64 | <!--{if $orderby != 'price'}--> |
---|
| 65 | <li><a href="javascript:fnChangeOrderby('price');" rel="external">価格順</a></li> |
---|
| 66 | <!--{else}--> |
---|
| 67 | <li class="on_number">価格順</li> |
---|
[19661] | 68 | <!--{/if}--> |
---|
[21050] | 69 | <!--{if $orderby != "date"}--> |
---|
| 70 | <li><a href="javascript:fnChangeOrderby('date');" rel="external">新着順</a></li> |
---|
| 71 | <!--{else}--> |
---|
| 72 | <li class="on_number">新着順</li> |
---|
| 73 | <!--{/if}--> |
---|
| 74 | </ul> |
---|
| 75 | </section> |
---|
| 76 | <!--▲ページナビ(本文)--> |
---|
[19661] | 77 | |
---|
[21050] | 78 | <!--{foreach from=$arrProducts item=arrProduct name=arrProducts}--> |
---|
| 79 | <!--{assign var=id value=$arrProduct.product_id}--> |
---|
| 80 | <!--{assign var=arrErr value=$arrProduct.arrErr}--> |
---|
| 81 | <!--▼商品--> |
---|
| 82 | <div class="list_area clearfix"> |
---|
| 83 | <!--★画像★--> |
---|
[21172] | 84 | <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> |
---|
[21050] | 85 | |
---|
| 86 | <div class="listrightblock"> |
---|
| 87 | <div class="statusArea"> |
---|
| 88 | <!--▼商品ステータス--> |
---|
| 89 | <!--{if count($productStatus[$id]) > 0}--> |
---|
| 90 | <ul class="status_icon"> |
---|
| 91 | <!--{foreach from=$productStatus[$id] item=status}--> |
---|
| 92 | <li><!--{$arrSTATUS[$status]}--></li> |
---|
| 93 | <!--{/foreach}--> |
---|
| 94 | </ul> |
---|
| 95 | <!--{/if}--> |
---|
| 96 | <!--▲商品ステータス--> |
---|
| 97 | </div> |
---|
[19661] | 98 | |
---|
[21050] | 99 | <!--★商品名★--> |
---|
| 100 | <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> |
---|
| 101 | |
---|
| 102 | <!--★商品価格★--> |
---|
| 103 | <p><span class="pricebox sale_price"><span class="mini">販売価格(税込):</span></span> |
---|
| 104 | <span class="price"> |
---|
| 105 | <span id="price02_default_<!--{$id}-->"> |
---|
| 106 | <!--{if $arrProduct.price02_min == $arrProduct.price02_max}--> |
---|
| 107 | <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> |
---|
| 108 | <!--{else}--> |
---|
| 109 | <!--{$arrProduct.price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrProduct.price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> |
---|
| 110 | <!--{/if}--> |
---|
| 111 | </span><span id="price02_dynamic_<!--{$id}-->"> |
---|
| 112 | </span>円 |
---|
| 113 | </span></p> |
---|
| 114 | <!--★商品コメント価格★--> |
---|
| 115 | <p class="listcomment"><!--{$arrProduct.main_list_comment|h|nl2br}--></p> |
---|
| 116 | </div> |
---|
| 117 | </div> |
---|
| 118 | <!--▲商品--> |
---|
| 119 | |
---|
| 120 | <!--{foreachelse}--> |
---|
| 121 | <!--{include file="frontparts/search_zero.tpl"}--> |
---|
| 122 | <!--{/foreach}--> |
---|
[19661] | 123 | |
---|
[21050] | 124 | <!--{if count($arrProducts) < $tpl_linemax}--> |
---|
[21107] | 125 | <div class="btn_area"> |
---|
[21050] | 126 | <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> |
---|
[21107] | 127 | </div> |
---|
[21050] | 128 | <!--{/if}--> |
---|
| 129 | </section> |
---|
[21107] | 130 | <!--▼検索バー --> |
---|
| 131 | <section id="search_area"> |
---|
| 132 | <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
| 133 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 134 | <input type="search" name="name" id="search" value="" placeholder="キーワードを入力" class="searchbox" > |
---|
| 135 | </form> |
---|
| 136 | </section> |
---|
| 137 | <!--▲検索バー --> |
---|
[21050] | 138 | <!--▲CONTENTS--> |
---|
[20540] | 139 | |
---|
[21050] | 140 | <script> |
---|
| 141 | var pageNo = 2; |
---|
| 142 | var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; |
---|
| 143 | var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/"; |
---|
| 144 | var statusImagePath = "<!--{$TPL_URLPATH}-->"; |
---|
[20540] | 145 | |
---|
[21050] | 146 | function getProducts(limit) { |
---|
| 147 | $.mobile.pageLoading(); |
---|
| 148 | var i = limit; |
---|
| 149 | //送信データを準備 |
---|
| 150 | var postData = {}; |
---|
| 151 | $('#form1').find(':input').each(function(){ |
---|
| 152 | postData[$(this).attr('name')] = $(this).val(); |
---|
| 153 | }); |
---|
| 154 | postData["mode"] = "json"; |
---|
| 155 | postData["pageno"] = pageNo; |
---|
[19661] | 156 | |
---|
[21050] | 157 | $.ajax({ |
---|
| 158 | type: "POST", |
---|
| 159 | data: postData, |
---|
| 160 | cache: false, |
---|
| 161 | dataType: "json", |
---|
| 162 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
| 163 | alert(textStatus); |
---|
| 164 | $.mobile.pageLoading(true); |
---|
| 165 | }, |
---|
| 166 | success: function(result){ |
---|
| 167 | |
---|
| 168 | var productStatus = result.productStatus; |
---|
| 169 | for (var j = 0; j < i; j++) { |
---|
| 170 | if (result[j] != null) { |
---|
| 171 | var product = result[j]; |
---|
| 172 | var productHtml = ""; |
---|
| 173 | var maxCnt = $(".list_area").length - 1; |
---|
| 174 | var productEl = $(".list_area").get(maxCnt); |
---|
| 175 | productEl = $(productEl).clone(true).insertAfter(productEl); |
---|
| 176 | maxCnt++; |
---|
[20614] | 177 | |
---|
[21050] | 178 | //商品写真をセット |
---|
| 179 | $($(".list_area .listphoto img").get(maxCnt)).attr({ |
---|
| 180 | src: imagePath + product.main_list_image, |
---|
[21210] | 181 | alt: product.name, |
---|
| 182 | width: 80, |
---|
| 183 | height: 80 |
---|
[21050] | 184 | }); |
---|
[19661] | 185 | |
---|
[21182] | 186 | // 商品ステータスをセット |
---|
| 187 | var statusAreaEl = $($(".list_area div.statusArea").get(maxCnt)); |
---|
| 188 | // 商品ステータスの削除 |
---|
[21050] | 189 | statusAreaEl.empty(); |
---|
[20614] | 190 | |
---|
[21050] | 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); |
---|
[19661] | 222 | |
---|
[21050] | 223 | } |
---|
| 224 | } |
---|
| 225 | pageNo++; |
---|
[19661] | 226 | |
---|
[21050] | 227 | //すべての商品を表示したか判定 |
---|
| 228 | if (parseInt($("#productscount").text()) <= $(".list_area").length) { |
---|
| 229 | $("#btn_more_product").hide(); |
---|
| 230 | } |
---|
| 231 | $.mobile.pageLoading(true); |
---|
| 232 | } |
---|
| 233 | }); |
---|
| 234 | } |
---|
[21172] | 235 | </script> |
---|