source: branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/payment.tpl @ 20407

Revision 20407, 14.6 KB checked in by kotani, 13 years ago (diff)

#812 (トランザクションIDの自動生成/自動検証), #1053 (transactionidが埋め込まれる前にクリックされるとエラー)

  • transactionid用hiddenタグをJavaScriptで生成しないように変更
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2 * This file is part of EC-CUBE
3 *
4 * Copyright(c) 2000-2010 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<!--▼CONTENTS-->
23<script type="text/javascript">//<![CDATA[
24    $(function() {
25        if ($('input[name=deliv_id]:checked').val()
26            || $('#deliv_id').val()) {
27            showForm(true);
28        } else {
29            showForm(false);
30        }
31        $('input[id^=deliv_]').click(function() {
32            showForm(true);
33            var data = {};
34            data.mode = 'select_deliv';
35            data.deliv_id = $(this).val();
36            data['<!--{$smarty.const.TRANSACTION_ID_NAME}-->'] = '<!--{$transactionid}-->';
37            $.ajax({
38                type : 'POST',
39                url : location.pathname,
40                data: data,
41                cache : false,
42                dataType : 'json',
43                error : remoteException,
44                success : function(data, dataType) {
45                    if (data.error) {
46                        remoteException();
47                    } else {
48                        // 支払い方法の行を生成
49                        var payment_tbody = $('#payment tbody');
50                        payment_tbody.empty();
51                        for (var i in data.arrPayment) {
52                            // ラジオボタン
53                            var radio = $('<input type="radio" />')
54                                .attr('name', 'payment_id')
55                                .attr('id', 'pay_' + i)
56                                .val(data.arrPayment[i].payment_id);
57                            // ラベル
58                            var label = $('<label />')
59                                .attr('for', 'pay_' + i)
60                                .text(data.arrPayment[i].payment_method);
61                            // 行
62                            var tr = $('<tr />')
63                                .append($('<td />')
64                                        .addClass('centertd')
65                                        .append(radio))
66                                .append($('<td />').append(label));
67
68                            // 支払方法の画像が登録されている場合は表示
69                            if (data.img_show) {
70                                var payment_image = data.arrPayment[i].payment_image;
71                                $('th#payment_method').attr('colspan', 3);
72                                if (payment_image) {
73                                    var img = $('<img />').attr('src', '<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->' + payment_image);
74                                    tr.append($('<td />').append(img));
75                                } else {
76                                    tr.append($('<td />'));
77                                }
78                            } else {
79                                $('th#payment_method').attr('colspan', 2);
80                            }
81
82                            tr.appendTo(payment_tbody);
83                        }
84                        // お届け時間を生成
85                        var deliv_time_id_select = $('select[id^=deliv_time_id]');
86                        deliv_time_id_select.empty();
87                        deliv_time_id_select.append($('<option />').text('指定なし').val(''));
88                        for (var i in data.arrDelivTime) {
89                            var option = $('<option />')
90                                .val(i)
91                                .text(data.arrDelivTime[i])
92                                .appendTo(deliv_time_id_select);
93                        }
94                    }
95                }
96            });
97        });
98
99        /**
100         * 通信エラー表示.
101         */
102        function remoteException(XMLHttpRequest, textStatus, errorThrown) {
103            alert('通信中にエラーが発生しました。カート画面に移動します。');
104            location.href = '<!--{$smarty.const.CART_URLPATH}-->';
105        }
106
107        /**
108         * 配送方法の選択状態により表示を切り替える
109         */
110        function showForm(show) {
111            if (show) {
112                $('#payment, div.delivdate, .select-msg').show();
113                $('.non-select-msg').hide();
114            } else {
115                $('#payment, div.delivdate, .select-msg').hide();
116                $('.non-select-msg').show();
117            }
118        }
119    });
120//]]>
121</script>
122<div id="under02column">
123    <div id="under02column_shopping">
124        <h2 class="title"><!--{$tpl_title|h}--></h2>
125
126        <form name="form1" id="form1" method="post" action="?">
127            <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
128            <input type="hidden" name="mode" value="confirm" />
129            <input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" />
130            <!--{assign var=key value="deliv_id"}-->
131            <!--{if $is_single_deliv}-->
132                <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value}-->" id="deliv_id" />
133            <!--{else}-->
134            <div class="payarea">
135                <h3>配送方法の指定</h3>
136                <p>配送方法をご選択ください。</p>
137
138                <!--{if $arrErr[$key] != ""}-->
139                <p class="attention"><!--{$arrErr[$key]}--></p>
140                <!--{/if}-->
141                <table summary="配送方法選択">
142                    <tr>
143                        <th>選択</th>
144                        <th colspan="2">配送方法</th>
145                    </tr>
146                    <!--{section name=cnt loop=$arrDeliv}-->
147                    <tr>
148                        <td class="centertd"><input type="radio" id="deliv_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->"  value="<!--{$arrDeliv[cnt].deliv_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrDeliv[cnt].deliv_id|sfGetChecked:$arrForm[$key].value}--> />
149                        </td>
150                        <td>
151                            <label for="deliv_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrDeliv[cnt].name|h}--><!--{if $arrDeliv[cnt].remark != ""}--><p><!--{$arrDeliv[cnt].remark|h}--></p><!--{/if}--></label>
152                        </td>
153                    </tr>
154                    <!--{/section}-->
155                </table>
156            </div>
157            <!--{/if}-->
158
159            <div class="payarea">
160                <h3>お支払方法の指定</h3>
161                <p class="select-msg">お支払方法をご選択ください。</p>
162                <p class="non-select-msg">まずはじめに、配送方法を選択ください。</p>
163
164                <!--{assign var=key value="payment_id"}-->
165                <!--{if $arrErr[$key] != ""}-->
166                <p class="attention"><!--{$arrErr[$key]}--></p>
167                <!--{/if}-->
168                <table summary="お支払方法選択" id="payment">
169                  <thead>
170                    <tr>
171                        <th>選択</th>
172                        <th colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->" id="payment_method">お支払方法</th>
173                    </tr>
174                  </thead>
175                  <tbody>
176                    <!--{section name=cnt loop=$arrPayment}-->
177                    <tr>
178                        <td class="centertd"><input type="radio" id="pay_<!--{$smarty.section.cnt.iteration}-->" name="<!--{$key}-->" value="<!--{$arrPayment[cnt].payment_id}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" <!--{$arrPayment[cnt].payment_id|sfGetChecked:$arrForm[$key].value}--> />
179                        </td>
180                        <td>
181                            <label for="pay_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrPayment[cnt].payment_method|h}--><!--{if $arrPayment[cnt].note != ""}--><!--{/if}--></label>
182                        </td>
183                        <!--{if $img_show}-->
184                            <td>
185                                <!--{if $arrPayment[cnt].payment_image != ""}-->
186                                    <img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrPayment[cnt].payment_image}-->" />
187                                <!--{/if}-->
188                            </td>
189                        <!--{/if}-->
190                    </tr>
191                    <!--{/section}-->
192                  </tbody>
193                </table>
194            </div>
195
196            <!--{if $cartKey != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
197            <div class="payarea02">
198                <h3>お届け時間の指定</h3>
199                <p class="select-msg">ご希望の方は、お届け時間を選択してください。</p>
200                <p class="non-select-msg">まずはじめに、配送方法を選択ください。</p>
201                <!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
202                <!--{assign var=index value=$smarty.foreach.shippingItem.index}-->
203                <!--{if $is_multiple}-->
204                <div class="delivdate">
205                        &nbsp;<!--{$shippingItem.shipping_name01}--><!--{$shippingItem.shipping_name02}--><br />
206                        &nbsp;<!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01}--><!--{$shippingItem.shipping_addr02}-->
207                </div>
208                <!--{/if}-->
209                <div class="delivdate">
210                    <!--★お届け日★-->
211                    <!--{assign var=key value="deliv_date`$index`"}-->
212                    <span class="attention"><!--{$arrErr[$key]}--></span>
213                    <em>お届け日:</em>
214                    <!--{if !$arrDelivDate}-->
215                        ご指定頂けません。
216                    <!--{else}-->
217                        <select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
218                            <option value="" selected="">指定なし</option>
219                            <!--{html_options options=$arrDelivDate selected=$arrForm[$key].value}-->
220                        </select>
221                    <!--{/if}-->
222                </div>
223                <div class="delivdate">
224                    <!--★お届け時間★-->
225                    <!--{assign var=key value="deliv_time_id`$index`"}-->
226                    <span class="attention"><!--{$arrErr[$key]}--></span>
227                    <em>お届け時間:</em>
228                    <select name="<!--{$key}-->" id="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
229                        <option value="" selected="">指定なし</option>
230                        <!--{html_options options=$arrDelivTime selected=$arrForm[$key].value}-->
231                    </select>
232                </div>
233                <!--{/foreach}-->
234            </div>
235            <!--{/if}-->
236
237            <div class="payarea02">
238                <h3>その他お問い合わせ</h3>
239                <p>その他お問い合わせ事項がございましたら、こちらにご入力ください。</p>
240                <div>
241                    <!--★その他お問い合わせ事項★-->
242                    <!--{assign var=key value="message"}-->
243                    <span class="attention"><!--{$arrErr[$key]}--></span>
244                    <textarea name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" cols="80" rows="8" class="area660" wrap="hard"><!--{$arrForm[$key].value|h}--></textarea>
245                </div>
246                <div>
247                    <span class="attention"> (<!--{$smarty.const.LTEXT_LEN}-->文字まで)</span>
248                </div>
249            </div>
250
251            <!-- ▼ポイント使用 ここから -->
252            <!--{if $tpl_login == 1 && $smarty.const.USE_POINT !== false}-->
253                <div class="pointarea">
254                    <h3>ポイント使用の指定</h3>
255
256                        <p><span class="attention">1ポイントを1円</span>として使用する事ができます。<br />
257                            使用する場合は、「ポイントを使用する」にチェックを入れた後、使用するポイントをご記入ください。</p>
258                    <div>
259                        <p><!--{$name01|h}--> <!--{$name02|h}-->様の、現在の所持ポイントは「<em><!--{$tpl_user_point|default:0}-->Pt</em>」です。</p>
260                        <p>今回ご購入合計金額:<span class="price"><!--{$arrPrices.subtotal|number_format}-->円</span> <span class="attention">(送料、手数料を含みません。)</span></p>
261                        <ul>
262                            <li><input type="radio" id="point_on" name="point_check" value="1" <!--{$arrForm.point_check.value|sfGetChecked:1}--> onclick="fnCheckInputPoint();" /><label for="point_on">ポイントを使用する</label></li>
263                             <!--{assign var=key value="use_point"}-->
264
265                             <li class="underline">今回のお買い物で、<input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key].value|default:$tpl_user_point}-->" maxlength="<!--{$arrForm[$key].length}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" size="6" class="box60" />&nbsp;ポイントを使用する。<span class="attention"><!--{$arrErr[$key]}--></span></li>
266                             <li><input type="radio" id="point_off" name="point_check" value="2" <!--{$arrForm.point_check.value|sfGetChecked:2}--> onclick="fnCheckInputPoint();" /><label for="point_off">ポイントを使用しない</label></li>
267                        </ul>
268                    </div>
269                </div>
270            <!--{/if}-->
271            <!-- ▲ポイント使用 ここまで -->
272
273            <div class="tblareabtn">
274                <a href="<!--{$tpl_back_url|h}-->" class="spbtn spbtn-medeum">
275                    戻る</a>&nbsp;
276                <input type="submit" value="次へ" class="spbtn spbtn-shopping" width="130" height="30" alt="次へ" name="next" id="next" />
277            </div>
278        </form>
279    </div>
280</div>
281<!--▲CONTENTS-->
Note: See TracBrowser for help on using the repository browser.