[19713] | 1 | <!--{* |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[22206] | 5 | * Copyright(c) 2000-2013 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 | *}--> |
---|
[21537] | 24 | |
---|
[21050] | 25 | <section id="mypagecolumn"> |
---|
[21533] | 26 | <h2 class="title"><!--{$tpl_title|h}--></h2> |
---|
| 27 | <!--{if $tpl_navi != ""}--> |
---|
[21050] | 28 | <!--{include file=$tpl_navi}--> |
---|
[21533] | 29 | <!--{else}--> |
---|
[21050] | 30 | <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}--> |
---|
[21533] | 31 | <!--{/if}--> |
---|
[19713] | 32 | |
---|
[21533] | 33 | <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3> |
---|
| 34 | <!--{if $tpl_linemax > 0}--> |
---|
[19713] | 35 | |
---|
[21533] | 36 | <!--★インフォメーション★--> |
---|
| 37 | <div class="information"> |
---|
| 38 | <p><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>のお気に入りがあります。</p> |
---|
| 39 | </div> |
---|
[19713] | 40 | |
---|
[21533] | 41 | <!--▼フォームここから --> |
---|
| 42 | <div class="form_area"> |
---|
[19713] | 43 | |
---|
[21533] | 44 | <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php"> |
---|
| 45 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
| 46 | <input type="hidden" name="mode" value="cart" /> |
---|
| 47 | <input type="hidden" name="product_id" value="" /> |
---|
[19713] | 48 | |
---|
[21050] | 49 | |
---|
[21533] | 50 | <!--▼フォームボックスここから --> |
---|
| 51 | <div class="formBox"> |
---|
| 52 | <!--{section name=cnt loop=$arrFavorite max=$dispNumber}--> |
---|
| 53 | <!--{assign var=product_id value="`$arrFavorite[cnt].product_id`"}--> |
---|
[21050] | 54 | |
---|
[21533] | 55 | <!--▼商品 --> |
---|
| 56 | <div class="favoriteBox"> |
---|
[23122] | 57 | <a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrFavorite[cnt].main_list_image|sfNoImageMainList|h}-->" style="max-width: 80px;max-height: 80px;" class="photoL productImg" /></a> |
---|
[21533] | 58 | <div class="favoriteContents clearfix"> |
---|
| 59 | <h4><a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->" class="productName"><!--{$arrFavorite[cnt].name}--></a></h4> |
---|
[21708] | 60 | <p><span class="mini productPrice"><!--{$smarty.const.SALE_PRICE_TITLE}-->:<!--{if $arrFavorite[cnt].price02_min_inctax == $arrFavorite[cnt].price02_max_inctax}--> |
---|
| 61 | <!--{$arrFavorite[cnt].price02_min_inctax|number_format}--> |
---|
[21533] | 62 | <!--{else}--> |
---|
[21708] | 63 | <!--{$arrFavorite[cnt].price02_min_inctax|number_format}-->~<!--{$arrFavorite[cnt].price02_max_inctax|number_format}--> |
---|
[21533] | 64 | <!--{/if}-->円</span></p> |
---|
[23066] | 65 | <p class="btn_delete"><img src="<!--{$TPL_URLPATH}-->img/button/btn_delete.png" width="21" height="20" alt="削除" onclick="javascript:eccube.setModeAndSubmit('delete_favorite','product_id','<!--{$product_id|h}-->');" class="pointer" /></p> |
---|
[21533] | 66 | </div> |
---|
| 67 | </div><!--▲商品 --> |
---|
| 68 | <!--{/section}--> |
---|
| 69 | </div><!-- /.formBox --> |
---|
| 70 | |
---|
| 71 | <!--{if $stock_find_count > 0 && $customer_rank < 51}--> |
---|
| 72 | <div class="product-btn"> |
---|
| 73 | <a rel="external" href="javascript:void(document.form1.submit())" class="btn-cart">カートに入れる</a> |
---|
| 74 | </div> |
---|
| 75 | <!--{/if}--> |
---|
| 76 | </form> |
---|
| 77 | </div><!-- /.form_area --> |
---|
| 78 | |
---|
| 79 | <div class="btn_area"> |
---|
| 80 | <!--{if $tpl_linemax > $dispNumber}--> |
---|
[23230] | 81 | <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_product" onclick="getProducts(<!--{$dispNumber}-->); return false;">もっとみる(+<!--{$dispNumber}-->件)</a></p> |
---|
[21533] | 82 | <!--{/if}--> |
---|
[21050] | 83 | </div> |
---|
| 84 | |
---|
[21533] | 85 | <!--{else}--> |
---|
| 86 | <div class="form_area"> |
---|
| 87 | <div class="information"> |
---|
[21050] | 88 | <p>お気に入りが登録されておりません。</p> |
---|
[21535] | 89 | </div> |
---|
[21533] | 90 | </div><!-- /.form_area --> |
---|
| 91 | <!--{/if}--> |
---|
[21050] | 92 | |
---|
| 93 | </section> |
---|
[21533] | 94 | |
---|
[23002] | 95 | <!--{include file= 'frontparts/search_area.tpl'}--> |
---|
[21050] | 96 | |
---|
| 97 | <script> |
---|
[21533] | 98 | var pageNo = 2; |
---|
| 99 | var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; |
---|
[22788] | 100 | var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->"; |
---|
[21533] | 101 | var statusImagePath = "<!--{$TPL_URLPATH}-->"; |
---|
[21050] | 102 | |
---|
[21533] | 103 | function getProducts(limit) { |
---|
| 104 | $.mobile.showPageLoadingMsg(); |
---|
| 105 | var i = limit; |
---|
| 106 | //送信データを準備 |
---|
| 107 | var postData = {}; |
---|
[21535] | 108 | $('#form1').find(':input').each(function(){ |
---|
| 109 | postData[$(this).attr('name')] = $(this).val(); |
---|
[21533] | 110 | }); |
---|
| 111 | postData["mode"] = "getList"; |
---|
| 112 | postData["pageno"] = pageNo; |
---|
| 113 | postData["disp_number"] = i; |
---|
[21050] | 114 | |
---|
[21533] | 115 | $.ajax({ |
---|
| 116 | type: "POST", |
---|
| 117 | url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php", |
---|
| 118 | data: postData, |
---|
| 119 | cache: false, |
---|
| 120 | dataType: "json", |
---|
| 121 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
| 122 | alert(textStatus); |
---|
| 123 | $.mobile.hidePageLoadingMsg(); |
---|
| 124 | }, |
---|
| 125 | success: function(result){ |
---|
| 126 | var productStatus = result.productStatus; |
---|
| 127 | for (var j = 0; j < i; j++) { |
---|
| 128 | if (result[j] != null) { |
---|
| 129 | var product = result[j]; |
---|
| 130 | var productHtml = ""; |
---|
| 131 | var maxCnt = $(".favoriteBox").length - 1; |
---|
| 132 | var productEl = $(".favoriteBox").get(maxCnt); |
---|
| 133 | productEl = $(productEl).clone(true).insertAfter(productEl); |
---|
| 134 | maxCnt++; |
---|
[21050] | 135 | |
---|
[21533] | 136 | //商品写真をセット |
---|
| 137 | $($(".favoriteBox img.productImg").get(maxCnt)).attr({ |
---|
[21535] | 138 | src: imagePath + product.main_list_image, |
---|
[21533] | 139 | alt: product.name |
---|
| 140 | }); |
---|
[21050] | 141 | |
---|
[21533] | 142 | //商品名をセット |
---|
| 143 | $($(".favoriteBox a.productName").get(maxCnt)).text(product.name); |
---|
| 144 | $($(".favoriteBox a.productName").get(maxCnt)).attr("href", url + product.product_id); |
---|
| 145 | |
---|
| 146 | //販売価格をセット |
---|
| 147 | var price = $($(".favoriteBox span.productPrice").get(maxCnt)); |
---|
| 148 | //販売価格をクリア |
---|
| 149 | price.empty(); |
---|
| 150 | var priceVale = ""; |
---|
| 151 | //販売価格が範囲か判定 |
---|
| 152 | if (product.price02_min == product.price02_max) { |
---|
[22486] | 153 | priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '円'; |
---|
[21533] | 154 | } else { |
---|
[22486] | 155 | priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '~' + product.price02_max_inctax_format + '円'; |
---|
[21533] | 156 | } |
---|
| 157 | price.append(priceVale); |
---|
| 158 | |
---|
| 159 | //削除ボタンをセット |
---|
[23066] | 160 | $($(".favoriteBox p.btn_delete img").get(maxCnt)).attr("onclick", "javascript:eccube.setModeAndSubmit('delete_favorite','product_id','" + product.product_id + "');"); |
---|
[21533] | 161 | |
---|
| 162 | } |
---|
| 163 | } |
---|
| 164 | pageNo++; |
---|
| 165 | |
---|
[22960] | 166 | //全ての商品を表示したか判定 |
---|
[21533] | 167 | if (parseInt($("#productscount").text()) <= $(".favoriteBox").length) { |
---|
| 168 | $("#btn_more_product").hide(); |
---|
| 169 | } |
---|
| 170 | $.mobile.hidePageLoadingMsg(); |
---|
| 171 | } |
---|
| 172 | }); |
---|
| 173 | } |
---|
[21128] | 174 | </script> |
---|