[19713] | 1 | <!--{* |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[20764] | 5 | * Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved. |
---|
[19713] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | *}--> |
---|
[21050] | 24 | <!--▼CONTENTS--> |
---|
| 25 | <section id="mypagecolumn"> |
---|
| 26 | <h2 class="title"><!--{$tpl_title|h}--></h2> |
---|
| 27 | <!--{if $tpl_navi != ""}--> |
---|
| 28 | <!--{include file=$tpl_navi}--> |
---|
| 29 | <!--{else}--> |
---|
| 30 | <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}--> |
---|
| 31 | <!--{/if}--> |
---|
[19713] | 32 | |
---|
[21050] | 33 | <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3> |
---|
| 34 | <!--{if $tpl_linemax > 0}--> |
---|
[19713] | 35 | |
---|
[21050] | 36 | <!--★インフォメーション★--> |
---|
| 37 | <div class="information"> |
---|
| 38 | <p><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>のお気に入りがあります。</p> |
---|
| 39 | <p>最大20件まで登録できます。</p> |
---|
| 40 | </div> |
---|
[19713] | 41 | |
---|
[21050] | 42 | <!--▼フォームここから --> |
---|
| 43 | <div class="form_area"> |
---|
[19713] | 44 | |
---|
[21050] | 45 | <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php"> |
---|
| 46 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 47 | <input type="hidden" name="mode" value="cart" /> |
---|
| 48 | <input type="hidden" name="product_id" value="" /> |
---|
[19713] | 49 | |
---|
[21050] | 50 | |
---|
| 51 | <!--▼フォームボックスここから --> |
---|
| 52 | <div class="formBox"> |
---|
| 53 | <!--{section name=cnt loop=$arrFavorite max=$dispNumber}--> |
---|
| 54 | <!--{assign var=product_id value="`$arrFavorite[cnt].product_id`"}--> |
---|
| 55 | |
---|
| 56 | <!--▼商品 --> |
---|
| 57 | <div class="favoriteBox"> |
---|
| 58 | <a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrFavorite[cnt].main_list_image|sfNoImageMainList|h}-->&width=80&height=80" alt="" width="80" height="80" class="photoL productImg" /></a> |
---|
| 59 | <div class="favoriteContents clearfix"> |
---|
| 60 | <h4><a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->" class="productName"><!--{$arrFavorite[cnt].name}--></a></h4> |
---|
| 61 | <p><span class="mini productPrice"><!--{$smarty.const.SALE_PRICE_TITLE}-->:<!--{if $arrFavorite[cnt].price02_min == $arrFavorite[cnt].price02_max}--> |
---|
| 62 | <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> |
---|
| 63 | <!--{else}--> |
---|
| 64 | <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrFavorite[cnt].price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> |
---|
| 65 | <!--{/if}-->円</span></p> |
---|
| 66 | <p class="btn_delete"><img src="<!--{$TPL_URLPATH}-->img/button/btn_delete.png" width="21" height="20" alt="削除" onClick="javascript:fnModeSubmit('delete_favorite','product_id','<!--{$product_id|h}-->');" class="pointer" /></p> |
---|
| 67 | </div> |
---|
| 68 | </div><!--▲商品 --> |
---|
| 69 | |
---|
| 70 | <!--{/section}--> |
---|
| 71 | |
---|
| 72 | </div><!--▲formBox --> |
---|
| 73 | <!--{if $stock_find_count > 0 && $customer_rank < 51}--> |
---|
| 74 | <div class="product-btn"> |
---|
| 75 | <a rel="external" href="javascript:void(document.form1.submit())" class="btn-cart">カートに入れる</a> |
---|
| 76 | </div> |
---|
| 77 | <!--{/if}--> |
---|
| 78 | </form> |
---|
| 79 | </div><!--▲form_area --> |
---|
| 80 | |
---|
| 81 | <div class="btn_area"> |
---|
| 82 | <!--{if $tpl_linemax > $dispNumber}--> |
---|
| 83 | <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_product" onClick="getProducts(5); return false;">もっとみる(+<!--{$dispNumber}-->件)</a></p> |
---|
| 84 | <!--{/if}--> |
---|
| 85 | </div> |
---|
| 86 | |
---|
| 87 | <!--{else}--> |
---|
| 88 | <div class="form_area"> |
---|
| 89 | <div class="information"> |
---|
| 90 | <p>お気に入りが登録されておりません。</p> |
---|
| 91 | </div> |
---|
| 92 | </div><!--▲form_area --> |
---|
| 93 | <!--{/if}--> |
---|
| 94 | |
---|
| 95 | </section> |
---|
[21107] | 96 | <!--▼検索バー --> |
---|
| 97 | <section id="search_area"> |
---|
| 98 | <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
| 99 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 100 | <input type="search" name="name" id="search" value="" placeholder="キーワードを入力" class="searchbox" > |
---|
| 101 | </form> |
---|
| 102 | </section> |
---|
| 103 | <!--▲検索バー --> |
---|
[21050] | 104 | <!--▲CONTENTS --> |
---|
| 105 | |
---|
| 106 | <script> |
---|
| 107 | var pageNo = 2; |
---|
| 108 | var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; |
---|
| 109 | var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/"; |
---|
| 110 | var statusImagePath = "<!--{$TPL_URLPATH}-->"; |
---|
| 111 | |
---|
| 112 | function getProducts(limit) { |
---|
| 113 | $.mobile.pageLoading(); |
---|
| 114 | var i = limit; |
---|
| 115 | //送信データを準備 |
---|
| 116 | var postData = {}; |
---|
| 117 | $('#form1').find(':input').each(function(){ |
---|
| 118 | postData[$(this).attr('name')] = $(this).val(); |
---|
| 119 | }); |
---|
| 120 | postData["mode"] = "getList"; |
---|
| 121 | postData["pageno"] = pageNo; |
---|
| 122 | postData["disp_number"] = i; |
---|
| 123 | |
---|
| 124 | $.ajax({ |
---|
| 125 | type: "POST", |
---|
| 126 | url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php", |
---|
| 127 | data: postData, |
---|
| 128 | cache: false, |
---|
| 129 | dataType: "json", |
---|
| 130 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
| 131 | alert(textStatus); |
---|
| 132 | $.mobile.pageLoading(true); |
---|
| 133 | }, |
---|
| 134 | success: function(result){ |
---|
| 135 | |
---|
| 136 | var productStatus = result.productStatus; |
---|
| 137 | for (var j = 0; j < i; j++) { |
---|
| 138 | if (result[j] != null) { |
---|
| 139 | var product = result[j]; |
---|
| 140 | var productHtml = ""; |
---|
| 141 | var maxCnt = $(".favoriteBox").length - 1; |
---|
| 142 | var productEl = $(".favoriteBox").get(maxCnt); |
---|
| 143 | productEl = $(productEl).clone(true).insertAfter(productEl); |
---|
| 144 | maxCnt++; |
---|
| 145 | |
---|
| 146 | //商品写真をセット |
---|
| 147 | $($(".favoriteBox img.productImg").get(maxCnt)).attr({ |
---|
| 148 | src: imagePath + product.main_list_image, |
---|
| 149 | alt: product.name |
---|
| 150 | }); |
---|
| 151 | |
---|
| 152 | //商品名をセット |
---|
| 153 | $($(".favoriteBox a.productName").get(maxCnt)).text(product.name); |
---|
| 154 | $($(".favoriteBox a.productName").get(maxCnt)).attr("href", url + product.product_id); |
---|
| 155 | |
---|
| 156 | //販売価格をセット |
---|
| 157 | var price = $($(".favoriteBox span.productPrice").get(maxCnt)); |
---|
| 158 | //販売価格をクリア |
---|
| 159 | price.empty(); |
---|
| 160 | var priceVale = ""; |
---|
| 161 | //販売価格が範囲か判定 |
---|
| 162 | if (product.price02_min == product.price02_max) { |
---|
| 163 | priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '円'; |
---|
| 164 | } else { |
---|
| 165 | priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円'; |
---|
| 166 | } |
---|
| 167 | price.append(priceVale); |
---|
| 168 | |
---|
| 169 | //削除ボタンをセット |
---|
| 170 | $($(".favoriteBox p.btn_delete a").get(maxCnt)).attr("href", "javascript:fnModeSubmit('delete_favorite','product_id','" + product.product_id + "');"); |
---|
| 171 | |
---|
| 172 | } |
---|
| 173 | } |
---|
| 174 | pageNo++; |
---|
| 175 | |
---|
| 176 | //すべての商品を表示したか判定 |
---|
| 177 | if (parseInt($("#productscount").text()) <= $(".favoriteBox").length) { |
---|
| 178 | $("#btn_more_product").hide(); |
---|
| 179 | } |
---|
| 180 | $.mobile.pageLoading(true); |
---|
| 181 | } |
---|
| 182 | }); |
---|
| 183 | } |
---|
| 184 | </script> |
---|