[Svn-src-all:1224] [version-2_5-dev 20112] #990(配送設定・支払方法設定の仕様変更)
nanasess
admin @ mail.ec-cube.net
2011年 2月 8日 (火) 00:39:38 JST
Subversion committed to /home/svn/open 20112
http://svn.ec-cube.net/open_trac/changeset/20112
┌────────────────────────────┐
│更新者 : nanasess │
│更新日時: 2011-02-08 00:39:38 +0900 (火, 08 2月 2011)│
└────────────────────────────┘
Log:
--------------------------------------------------------
#990(配送設定・支払方法設定の仕様変更)
* 支払方法設定ページ
Changed: [U:修正,A:追加,D:削除]
--------------------------------------------------------
U branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl
U branches/version-2_5-dev/data/Smarty/templates/default/shopping/payment.tpl
U branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl
U branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/payment.tpl
A branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/select_deliv.tpl
U branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl
U branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/payment.tpl
U branches/version-2_5-dev/data/class/SC_CartSession.php
U branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
U branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php
U branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
U branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
U branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
変更: branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/default/shopping/confirm.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -243,14 +243,17 @@
<!--{/if}-->
<!--お届け先ここまで-->
- <h3>▼お支払方法・その他お問い合わせ</h3>
- <table summary="お支払方法・その他お問い合わせ" class="delivname">
+ <h3>▼配送方法・お支払方法・その他お問い合わせ</h3>
+ <table summary="配送方法・お支払方法・その他お問い合わせ" class="delivname">
<tbody>
<tr>
+ <th>配送方法</th>
+ <td><!--{$arrDeliv[$arrData.deliv_id]|h}--></td>
+ </tr>
+ <tr>
<th>お支払方法</th>
<td><!--{$arrData.payment_method|h}--></td>
</tr>
- <!--{* 販売方法判定(ダウンロード販売のみの場合はお届け日、時間を表示しない) *}-->
<tr>
<th>その他お問い合わせ</th>
<td><!--{$arrData.message|h|nl2br}--></td>
@@ -258,10 +261,6 @@
</tbody>
</table>
- <!--{if 'sfTSPrintOrderBox'|function_exists}-->
- <!--{'sfTSPrintOrderBox'|call_user_func}-->
- <!--{/if}-->
-
<div class="tblareabtn">
<a href="./payment.php" onmouseover="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_back_on.gif',back03)" onmouseout="chgImgImageSubmit('<!--{$TPL_URLPATH}-->img/button/btn_back.gif',back03)"><img src="<!--{$TPL_URLPATH}-->img/button/btn_back.gif" width="150" height="30" alt="戻る" border="0" name="back03" id="back03" /></a>
<!--{if $payment_type != ""}-->
変更: branches/version-2_5-dev/data/Smarty/templates/default/shopping/payment.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/default/shopping/payment.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/default/shopping/payment.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -20,6 +20,84 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<!--▼CONTENTS-->
+<script type="text/javascript">//<![CDATA[
+ $(function() {
+ $('input[id^=deliv_]').click(function() {
+ var data = {};
+ data.mode = 'select_deliv';
+ data.deliv_id = $(this).val();
+ $.ajax({
+ type : 'POST',
+ url : location.pathname,
+ data: data,
+ cache : false,
+ dataType : 'json',
+ error : remoteException,
+ success : function(data, dataType) {
+ if (data.error) {
+ remoteException();
+ } else {
+ // 支払い方法の行を生成
+ var payment_tbody = $('#payment tbody');
+ payment_tbody.empty();
+ for (var i in data.arrPayment) {
+ // ラジオボタン
+ var radio = $('<input type="radio" />')
+ .attr('name', 'payment_id')
+ .attr('id', 'pay_' + i)
+ .val(data.arrPayment[i].payment_id);
+ // ラベル
+ var label = $('<label />')
+ .attr('for', 'pay_' + i)
+ .text(data.arrPayment[i].payment_method);
+ // 行
+ var tr = $('<tr />')
+ .append($('<td />')
+ .addClass('centertd')
+ .append(radio))
+ .append($('<td />').append(label));
+
+ // 支払方法の画像が登録されている場合は表示
+ if (data.img_show) {
+ var payment_image = data.arrPayment[i].payment_image;
+ $('th#payment_method').attr('colspan', 3);
+ if (payment_image) {
+ var img = $('<img />').attr('src', '<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->' + payment_image);
+ tr.append($('<td />').append(img));
+ } else {
+ tr.append($('<td />'));
+ }
+ } else {
+ $('th#payment_method').attr('colspan', 2);
+ }
+
+ tr.appendTo(payment_tbody);
+ }
+ // お届け時間を生成
+ var deliv_time_id_select = $('select[id^=deliv_time_id]');
+ deliv_time_id_select.empty();
+ deliv_time_id_select.append($('<option />').text('指定なし').val(''));
+ for (var i in data.arrDelivTime) {
+ var option = $('<option />')
+ .val(i)
+ .text(data.arrDelivTime[i])
+ .appendTo(deliv_time_id_select);
+ }
+ }
+ }
+ });
+ });
+
+ /**
+ * 通信エラー表示.
+ */
+ function remoteException(XMLHttpRequest, textStatus, errorThrown) {
+ alert('通信中にエラーが発生しました。カート画面に移動します。');
+ location.href = '<!--{$smarty.const.CART_URLPATH}-->';
+ }
+ });
+//]]>
+</script>
<div id="under02column">
<div id="under02column_shopping">
<p class="flowarea">
@@ -30,26 +108,58 @@
<form name="form1" id="form1" method="post" action="?">
<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" />
+
+ <!--{assign var=key value="deliv_id"}-->
+ <!--{if $is_single_deliv}-->
+ <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value}-->" />
+ <!--{else}-->
<div class="payarea">
- <h3>お支払方法の指定</h3>
- <p>お支払方法をご選択ください。</p>
+ <h3>配送方法の指定</h3>
+ <p>配送方法をご選択ください。</p>
- <!--{assign var=key value="payment_id"}-->
<!--{if $arrErr[$key] != ""}-->
<p class="attention"><!--{$arrErr[$key]}--></p>
<!--{/if}-->
- <table summary="お支払方法選択">
+ <table summary="配送方法選択">
<tr>
<th>選択</th>
- <th colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->">お支払方法</th>
+ <th colspan="2">配送方法</th>
</tr>
- <!--{section name=cnt loop=$arrPayment}-->
+ <!--{section name=cnt loop=$arrDeliv}-->
<tr>
- <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}--> />
+ <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}--> />
</td>
<td>
- <label for="pay_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrPayment[cnt].payment_method|h}--><!--{if $arrPayment[cnt].note != ""}--><!--{/if}--></label>
+ <label for="deliv_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrDeliv[cnt].name|h}--><!--{if $arrDeliv[cnt].remark != ""}--><p><!--{$arrDeliv[cnt].remark|h}--></p><!--{/if}--></label>
</td>
+ </tr>
+ <!--{/section}-->
+ </table>
+ </div>
+ <!--{/if}-->
+
+ <div class="payarea">
+ <h3>お支払方法の指定</h3>
+ <p>お支払方法をご選択ください。</p>
+
+ <!--{assign var=key value="payment_id"}-->
+ <!--{if $arrErr[$key] != ""}-->
+ <p class="attention"><!--{$arrErr[$key]}--></p>
+ <!--{/if}-->
+ <table summary="お支払方法選択" id="payment">
+ <thead>
+ <tr>
+ <th>選択</th>
+ <th colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->" id="payment_method">お支払方法</th>
+ </tr>
+ </thead>
+ <tbody>
+ <!--{section name=cnt loop=$arrPayment}-->
+ <tr>
+ <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}--> /></td>
+ <td>
+ <label for="pay_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrPayment[cnt].payment_method|h}--><!--{if $arrPayment[cnt].note != ""}--><!--{/if}--></label>
+ </td>
<!--{if $img_show}-->
<td>
<!--{if $arrPayment[cnt].payment_image != ""}-->
@@ -57,8 +167,9 @@
<!--{/if}-->
</td>
<!--{/if}-->
- </tr>
+ </tr>
<!--{/section}-->
+ </tbody>
</table>
</div>
@@ -66,7 +177,7 @@
<div class="payarea02">
<h3>お届け時間の指定</h3>
<p>ご希望の方は、お届け時間を選択してください。</p>
- <!--{foreach item=shippingItem name=shippingItem from=$shipping}-->
+ <!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
<!--{assign var=index value=$smarty.foreach.shippingItem.index}-->
<div>
<!--★お届け日★-->
@@ -76,7 +187,7 @@
<!--{if !$arrDelivDate}-->
ご指定頂けません。
<!--{else}-->
- <select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
+ <select name="<!--{$key}-->" id="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
<option value="" selected="">指定なし</option>
<!--{html_options options=$arrDelivDate selected=$arrForm[$key].value}-->
</select>
@@ -89,7 +200,7 @@
<option value="" selected="">指定なし</option>
<!--{html_options options=$arrDelivTime selected=$arrForm[$key].value}-->
</select>
- <!--{if $isMultiple}-->
+ <!--{if $is_multiple}-->
<!--{$shippingItem.shipping_name01}--><!--{$shippingItem.shipping_name02}-->
<!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01}--><!--{$shippingItem.shipping_addr02}-->
<!--{/if}-->
変更: branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/confirm.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -96,6 +96,11 @@
<!--{/foreach}-->
<!--{/if}-->
+【配送方法】<br>
+<!--{$arrDeliv[$arrData.deliv_id]|h}--><br>
+
+<br>
+
【お支払い方法】<br>
<!--{$arrData.payment_method|h}--><br>
変更: branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/payment.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/payment.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/payment.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -24,6 +24,8 @@
<form method="post" action="?">
<input type="hidden" name="mode" value="confirm">
<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->">
+<!--{assign var=key value="deliv_id"}-->
+<input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value}-->">
■お支払方法 <font color="#FF0000">*</font><br>
<!--{assign var=key value="payment_id"}-->
<!--{if $arrErr[$key] != ""}-->
@@ -38,7 +40,7 @@
<!--{if $cartKey != $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
■お届け時間の指定<br>
-<!--{foreach item=shippingItem name=shippingItem from=$shipping}-->
+<!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
<!--{assign var=index value=$smarty.foreach.shippingItem.index}-->
<!--★お届け日★-->
<!--{assign var=key value="deliv_date`$index`"}-->
@@ -62,7 +64,7 @@
<!--{html_options options=$arrDelivTime selected=$arrForm[$key].value}-->
</select>
<br>
-<!--{if $isMultiple}-->
+<!--{if $is_multiple}-->
<!--{$shippingItem.shipping_name01}--><!--{$shippingItem.shipping_name02}-->
<!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01}--><!--{$shippingItem.shipping_addr02}-->
<!--{/if}-->
追加: branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/select_deliv.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/select_deliv.tpl (rev 0)
+++ branches/version-2_5-dev/data/Smarty/templates/mobile/shopping/select_deliv.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -0,0 +1,46 @@
+<!--{*
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+*}-->
+<form method="post" action="?">
+<input type="hidden" name="mode" value="select_deliv">
+<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->">
+■配送方法 <font color="#FF0000">*</font><br>
+<!--{assign var=key value="deliv_id"}-->
+<!--{if $arrErr[$key] != ""}-->
+<font color="#FF0000"><!--{$arrErr[$key]}--></font>
+<!--{/if}-->
+<!--{section name=cnt loop=$arrDeliv}-->
+<input type="radio" name="<!--{$key}-->" value="<!--{$arrDeliv[cnt].deliv_id}-->" <!--{$arrDeliv[cnt].deliv_id|sfGetChecked:$arrForm[$key].value}-->>
+<!--{$arrDeliv[cnt].name|h}-->
+<br>
+<!--{/section}-->
+<br>
+
+<center><input type="submit" value="次へ"></center>
+</form>
+
+<form action="<!--{$tpl_back_url|h}-->" method="get">
+<center><input type="submit" name="return" value="戻る"></center>
+</form>
+
+<br>
変更: branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/confirm.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -231,29 +231,22 @@
<!--{/if}-->
<!--お届け先ここまで-->
- <table summary="お支払方法・お届け日時の指定・その他お問い合わせ" class="delivname">
+ <table summary="配送方法・お支払方法・お届け日時の指定・その他お問い合わせ" class="delivname">
<thead>
<tr>
- <th colspan="2">▼お支払方法・お届け日時の指定・その他お問い合わせ</th>
+ <th colspan="2">▼配送方法・お支払方法・お届け日時の指定・その他お問い合わせ</th>
</tr>
</thead>
<tbody>
<tr>
+ <th>配送方法</th>
+ <td><!--{$arrDeliv[$arrData.deliv_id]|h}--></td>
+ </tr>
+ <tr>
<th>お支払方法</th>
<td><!--{$arrData.payment_method|h}--></td>
</tr>
- <!--{* 販売方法判定(ダウンロード販売のみの場合はお届け日、時間を表示しない) *}-->
- <!--{if $cartdown != "2"}-->
<tr>
- <th>お届け日</th>
- <td><!--{$arrData.deliv_date|default:"指定なし"|h}--></td>
- </tr>
- <tr>
- <th>お届け時間</th>
- <td><!--{$arrData.deliv_time|default:"指定なし"|h}--></td>
- </tr>
- <!--{/if}-->
- <tr>
<th>その他お問い合わせ</th>
<td><!--{$arrData.message|h|nl2br}--></td>
</tr>
変更: branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/payment.tpl
===================================================================
--- branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/payment.tpl 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/Smarty/templates/sphone/shopping/payment.tpl 2011-02-07 15:39:38 UTC (rev 20112)
@@ -20,6 +20,84 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*}-->
<!--▼CONTENTS-->
+<script type="text/javascript">//<![CDATA[
+ $(function() {
+ $('input[id^=deliv_]').click(function() {
+ var data = {};
+ data.mode = 'select_deliv';
+ data.deliv_id = $(this).val();
+ $.ajax({
+ type : 'POST',
+ url : location.pathname,
+ data: data,
+ cache : false,
+ dataType : 'json',
+ error : remoteException,
+ success : function(data, dataType) {
+ if (data.error) {
+ remoteException();
+ } else {
+ // 支払い方法の行を生成
+ var payment_tbody = $('#payment tbody');
+ payment_tbody.empty();
+ for (var i in data.arrPayment) {
+ // ラジオボタン
+ var radio = $('<input type="radio" />')
+ .attr('name', 'payment_id')
+ .attr('id', 'pay_' + i)
+ .val(data.arrPayment[i].payment_id);
+ // ラベル
+ var label = $('<label />')
+ .attr('for', 'pay_' + i)
+ .text(data.arrPayment[i].payment_method);
+ // 行
+ var tr = $('<tr />')
+ .append($('<td />')
+ .addClass('centertd')
+ .append(radio))
+ .append($('<td />').append(label));
+
+ // 支払方法の画像が登録されている場合は表示
+ if (data.img_show) {
+ var payment_image = data.arrPayment[i].payment_image;
+ $('th#payment_method').attr('colspan', 3);
+ if (payment_image) {
+ var img = $('<img />').attr('src', '<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->' + payment_image);
+ tr.append($('<td />').append(img));
+ } else {
+ tr.append($('<td />'));
+ }
+ } else {
+ $('th#payment_method').attr('colspan', 2);
+ }
+
+ tr.appendTo(payment_tbody);
+ }
+ // お届け時間を生成
+ var deliv_time_id_select = $('select[id^=deliv_time_id]');
+ deliv_time_id_select.empty();
+ deliv_time_id_select.append($('<option />').text('指定なし').val(''));
+ for (var i in data.arrDelivTime) {
+ var option = $('<option />')
+ .val(i)
+ .text(data.arrDelivTime[i])
+ .appendTo(deliv_time_id_select);
+ }
+ }
+ }
+ });
+ });
+
+ /**
+ * 通信エラー表示.
+ */
+ function remoteException(XMLHttpRequest, textStatus, errorThrown) {
+ alert('通信中にエラーが発生しました。カート画面に移動します。');
+ location.href = '<!--{$smarty.const.CART_URLPATH}-->';
+ }
+ });
+//]]>
+</script>
<div id="under02column">
<div id="under02column_shopping">
<h2 class="title"><!--{$tpl_title|h}--></h2>
@@ -27,7 +105,36 @@
<form name="form1" id="form1" method="post" action="?">
<input type="hidden" name="mode" value="confirm" />
<input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->" />
+ <!--{assign var=key value="deliv_id"}-->
+ <!--{if $is_single_deliv}-->
+ <input type="hidden" name="<!--{$key}-->" value="<!--{$arrForm[$key].value}-->" />
+ <!--{else}-->
<div class="payarea">
+ <h3>配送方法の指定</h3>
+ <p>配送方法をご選択ください。</p>
+
+ <!--{if $arrErr[$key] != ""}-->
+ <p class="attention"><!--{$arrErr[$key]}--></p>
+ <!--{/if}-->
+ <table summary="配送方法選択">
+ <tr>
+ <th>選択</th>
+ <th colspan="2">配送方法</th>
+ </tr>
+ <!--{section name=cnt loop=$arrDeliv}-->
+ <tr>
+ <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}--> />
+ </td>
+ <td>
+ <label for="deliv_<!--{$smarty.section.cnt.iteration}-->"><!--{$arrDeliv[cnt].name|h}--><!--{if $arrDeliv[cnt].remark != ""}--><p><!--{$arrDeliv[cnt].remark|h}--></p><!--{/if}--></label>
+ </td>
+ </tr>
+ <!--{/section}-->
+ </table>
+ </div>
+ <!--{/if}-->
+
+ <div class="payarea">
<h3>お支払方法の指定</h3>
<p>お支払方法をご選択ください。</p>
@@ -35,11 +142,14 @@
<!--{if $arrErr[$key] != ""}-->
<p class="attention"><!--{$arrErr[$key]}--></p>
<!--{/if}-->
- <table summary="お支払方法選択">
+ <table summary="お支払方法選択" id="payment">
+ <thead>
<tr>
<th>選択</th>
- <th colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->">お支払方法</th>
+ <th colspan="<!--{if !$img_show}-->2<!--{else}-->3<!--{/if}-->" id="payment_method">お支払方法</th>
</tr>
+ </thead>
+ <tbody>
<!--{section name=cnt loop=$arrPayment}-->
<tr>
<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}--> />
@@ -56,6 +166,7 @@
<!--{/if}-->
</tr>
<!--{/section}-->
+ </tbody>
</table>
</div>
@@ -63,9 +174,9 @@
<div class="payarea02">
<h3>お届け時間の指定</h3>
<p>ご希望の方は、お届け時間を選択してください。</p>
- <!--{foreach item=shippingItem name=shippingItem from=$shipping}-->
+ <!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
<!--{assign var=index value=$smarty.foreach.shippingItem.index}-->
- <!--{if $isMultiple}-->
+ <!--{if $is_multiple}-->
<div>
<!--{$shippingItem.shipping_name01}--><!--{$shippingItem.shipping_name02}--><br />
<!--{$arrPref[$shippingItem.shipping_pref]}--><!--{$shippingItem.shipping_addr01}--><!--{$shippingItem.shipping_addr02}-->
変更: branches/version-2_5-dev/data/class/SC_CartSession.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_CartSession.php 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/class/SC_CartSession.php 2011-02-07 15:39:38 UTC (rev 20112)
@@ -432,9 +432,10 @@
* エラーが発生した場合は, 商品をカート内から削除又は数量を調整し,
* エラーメッセージを返す.
*
- * 1. 削除/非表示商品のチェック
- * 2. 商品購入制限数のチェック
- * 3. 在庫数チェック
+ * 1. 商品種別に関連づけられた配送業者の存在チェック
+ * 2. 削除/非表示商品のチェック
+ * 3. 商品購入制限数のチェック
+ * 4. 在庫数チェック
*
* @param string $key 商品種別ID
* @return string エラーが発生した場合はエラーメッセージ
@@ -448,7 +449,16 @@
foreach (array_keys($items) as $key) {
$item =& $items[$key];
$product =& $item['productsClass'];
+
/*
+ * 配送業者のチェック
+ */
+ $arrDeliv = SC_Helper_Purchase_Ex::getDeliv($productTypeId);
+ if (SC_Utils_Ex::isBlank($arrDeliv)) {
+ $tpl_message .= "※「" . $product['name'] . "」はまだ配送の準備ができておりません。恐れ入りますがお問い合わせページよりお問い合わせください。\n";
+ }
+
+ /*
* 表示/非表示商品のチェック
*/
if (SC_Utils_Ex::isBlank($product)) {
変更: branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php 2011-02-07 15:39:38 UTC (rev 20112)
@@ -460,49 +460,48 @@
}
/**
- * 商品種別ID からお届け時間の配列を取得する.
+ * 配送業者IDからお届け時間の配列を取得する.
+ *
+ * @param integer $deliv_id 配送業者ID
+ * @return array お届け時間の配列
*/
- function getDelivTime($productTypeId) {
+ function getDelivTime($deliv_id) {
$objQuery =& SC_Query::getSingletonInstance();
- $from = <<< __EOS__
- dtb_deliv T1
- JOIN dtb_delivtime T2
- ON T1.deliv_id = T2. deliv_id
-__EOS__;
- $objQuery->setOrder("time_id");
- $results = $objQuery->select("time_id, deliv_time", $from,
- "product_type_id = ?", array($productTypeId));
- $arrDelivTime = array();
- foreach ($results as $val) {
- $arrDelivTime[$val['time_id']] = $val['deliv_time'];
- }
- return $arrDelivTime;
+ $objQuery->setOrder('time_id');
+ $results = $objQuery->select('time_id, deliv_time',
+ 'dtb_delivtime',
+ 'deliv_id = ?', array($deliv_id));
+ $arrDelivTime = array();
+ foreach ($results as $val) {
+ $arrDelivTime[$val['time_id']] = $val['deliv_time'];
+ }
+ return $arrDelivTime;
}
/**
* 商品種別ID から配送業者を取得する.
+ *
+ * @param integer $product_type_id 商品種別ID
+ * @return array 配送業者の配列
*/
- function getDeliv($productTypeId) {
+ function getDeliv($product_type_id) {
$objQuery =& SC_Query::getSingletonInstance();
- return $objQuery->select("*", "dtb_deliv", "product_type_id = ?",
- array($productTypeId));
+ $objQuery->setOrder('rank');
+ return $objQuery->select('*', 'dtb_deliv', 'product_type_id = ?',
+ array($product_type_id));
}
/**
- * 配送業者ID から, 有効な支払方法を取得する.
+ * 配送業者ID から, 有効な支払方法IDを取得する.
*
* @param integer $deliv_id 配送業者ID
* @return array 有効な支払方法IDの配列
*/
function getPayments($deliv_id) {
$objQuery =& SC_Query::getSingletonInstance();
- $from = <<< __EOS__
- dtb_deliv T1
- LEFT JOIN dtb_payment_options T2
- ON T1.deliv_id = T2.deliv_id
-__EOS__;
- $objQuery->setOrder('T2.rank');
- return $objQuery->getCol('payment_id', $from, 'T1.deliv_id = ?',
+ $objQuery->setOrder('rank');
+ return $objQuery->getCol('payment_id', 'dtb_payment_options',
+ 'deliv_id = ?',
array($deliv_id), MDB2_FETCHMODE_ORDERED);
}
変更: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php 2011-02-07 15:39:38 UTC (rev 20112)
@@ -49,6 +49,7 @@
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->arrMAILMAGATYPE = $masterData->getMasterData("mtb_mail_magazine_type");
$this->arrReminder = $masterData->getMasterData("mtb_reminder");
+ $this->arrDeliv = SC_Helper_DB_Ex::sfGetIDValueList("dtb_deliv", "deliv_id", "service_name");
$this->httpCacheControl('nocache');
}
@@ -93,7 +94,8 @@
// カート内商品のチェック
$this->tpl_message = $objCartSess->checkProducts($this->cartKey);
if (strlen($this->tpl_message) >= 1) {
- SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true);
+ SC_Response_Ex::sendRedirect(CART_URLPATH);
+ exit;
}
// カートの商品を取得
変更: branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php 2011-02-07 15:39:38 UTC (rev 20112)
@@ -78,27 +78,23 @@
$objCartSess = new SC_CartSession();
$objPurchase = new SC_Helper_Purchase_Ex();
$this->objCustomer = new SC_Customer();
-
- $this->shipping =& $objPurchase->getShippingTemp();
- $this->isMultiple = $objPurchase->isMultiple();
-
- // パラメータ管理クラス
$this->objFormParam = new SC_FormParam();
- // パラメータ情報の初期化
- $this->lfInitParam();
- // POST値の取得
- $this->objFormParam->setParam($_POST);
- $uniqid = $objSiteSess->getUniqId();
- $objPurchase->verifyChangeCart($uniqid, $objCartSess);
+ $this->arrShipping =& $objPurchase->getShippingTemp();
+ $this->is_multiple = $objPurchase->isMultiple();
+ $this->tpl_uniqid = $objSiteSess->getUniqId();
+ $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
- // ユニークIDを引き継ぐ
- $this->tpl_uniqid = $uniqid;
-
$this->cartKey = $objCartSess->getKey();
- // 配送時間を取得
- $this->arrDelivTime = $objPurchase->getDelivTime($this->cartKey);
+ // 配送業者を取得
+ $this->arrDeliv = $objPurchase->getDeliv($this->cartKey);
+ if (count($this->arrDeliv) == 1) {
+ $this->is_single_deliv = true;
+ $deliv_id = $this->arrDeliv[0]['deliv_id'];
+ } else {
+ $this->is_single_deliv = false;
+ }
// 会員ログインチェック
if($this->objCustomer->isLoginSuccess(true)) {
@@ -116,7 +112,7 @@
}
// 一時受注テーブルの読込
- $arrOrderTemp = $objPurchase->getOrderTemp($uniqid);
+ $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid);
//不正遷移チェック(正常に受注情報が格納されていない場合は一旦カート画面まで戻す)
if (!$arrOrderTemp) {
SC_Response_Ex::sendRedirect(CART_URLPATH);
@@ -128,7 +124,8 @@
$this->tpl_message = $objCartSess->checkProducts($this->cartKey);
if (strlen($this->tpl_message) >= 1) {
- SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true);
+ SC_Response_Ex::sendRedirect(CART_URLPATH);
+ exit;
}
// FIXME 使用ポイント, 手数料の扱い
$this->arrData = $objCartSess->calculate($this->cartKey, $objCustomer, 0, $objPurchase->getShippingPref());
@@ -136,29 +133,63 @@
// 購入金額の取得
$total_inctax = $objCartSess->getAllProductsTotal($this->cartKey);
- // FIXME 支払い方法の取得
- $arrDeliv = $objPurchase->getDeliv($this->cartKey);
- $this->arrPayment = $objPurchase->getPaymentsByPrice($total_inctax, $arrDeliv[0]['deliv_id']);
+ // お届け日一覧の取得
+ $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $this->cartKey);
switch($this->getMode()) {
+ case 'select_deliv':
+ $this->objFormParam->convParam();
+ $this->lfInitParam(true);
+ $this->objFormParam->setParam($_POST);
+ $arrErr = $this->objFormParam->checkError();
+ if (SC_Utils_Ex::isBlank($arrErr)) {
+ $deliv_id = $this->objFormParam->getValue('deliv_id');
+ $this->arrPayment = $objPurchase->getPaymentsByPrice($total_inctax, $deliv_id);
+ $this->img_show = $this->lfGetImgShow($this->arrPayment);
+ // 配送時間を取得
+ $this->arrDelivTime = $objPurchase->getDelivTime($deliv_id);
+ $arrSelectDeliv = array('error' => false,
+ 'arrPayment' => $this->arrPayment,
+ 'arrDelivTime' => $this->arrDelivTime,
+ 'img_show' => $this->img_show);
+ } else {
+ $arrSelectDeliv = array('error' => true);
+ }
+
+ if (SC_Display::detectDevice() != DEVICE_TYPE_MOBILE) {
+ $objJson = new Services_JSON();
+ echo $objJson->encode($arrSelectDeliv);
+ exit;
+ }
+ break;
+
case 'confirm':
+ // パラメータ情報の初期化
+ $this->lfInitParam();
+ // POST値の取得
+ $this->objFormParam->setParam($_POST);
// 入力値の変換
$this->objFormParam->convParam();
+ $deliv_id = $this->objFormParam->getValue('deliv_id');
+ $this->arrPayment = $objPurchase->getPaymentsByPrice($total_inctax, $deliv_id);
+ $this->arrDelivTime = $objPurchase->getDelivTime($deliv_id);
$this->arrErr = $this->lfCheckError($this->arrData, $this->arrPayment);
// 入力エラーなし
if(count($this->arrErr) == 0) {
foreach (array_keys($_SESSION['shipping']) as $key) {
$timeId = $this->objFormParam->getValue('deliv_time_id' . $key);
+
/* TODO
* SC_Purchase::getShippingTemp() で取得して,
* リファレンスで代入すると, セッションに添字を追加できない?
*/
+ $_SESSION['shipping'][$key]['deliv_id'] = $deliv_id;
$_SESSION['shipping'][$key]['time_id'] = $timeId;
$_SESSION['shipping'][$key]['shipping_time'] = $this->arrDelivTime[$timeId];
$_SESSION['shipping'][$key]['shipping_date'] = $this->objFormParam->getValue('deliv_date' . $key);
}
- $this->lfRegistData($uniqid, $objPurchase);
+ $this->lfRegistData($this->tpl_uniqid, $objPurchase);
// 正常に登録されたことを記録しておく
$objSiteSess->setRegistFlag();
@@ -166,15 +197,14 @@
SC_Response_Ex::sendRedirect(SHOPPING_CONFIRM_URLPATH);
exit;
}else{
- // ユーザユニークIDの取得
- $uniqid = $objSiteSess->getUniqId();
// 受注一時テーブルからの情報を格納
- $this->objFormParam->setParam($objPurchase->getOrderTemp($uniqid));
+ $this->img_show = $this->lfGetImgShow($this->arrPayment);
+ $this->objFormParam->setParam($objPurchase->getOrderTemp($this->tpl_uniqid));
}
break;
// 前のページに戻る
case 'return':
- // 非会員の場合
+
// 正常な推移であることを記録しておく
$objSiteSess->setRegistFlag();
SC_Response_Ex::sendRedirect(SHOPPING_URL);
@@ -182,15 +212,44 @@
break;
default:
- // 受注一時テーブルからの情報を格納
+
+ // 前のページから戻ってきた場合の初期値を設定
+ $this->lfInitParam();
$this->objFormParam->setParam($arrOrderTemp);
+ $this->objFormParam->convParam();
+
+ if (!$this->is_single_deliv) {
+ $deliv_id = $this->objFormParam->getValue('deliv_id');
+ }
+
+ if (!SC_Utils_Ex::isBlank($deliv_id)) {
+ $this->objFormParam->setValue('deliv_id', $deliv_id);
+ $this->arrPayment = $objPurchase->getPaymentsByPrice($total_inctax, $deliv_id);
+ // XXX セッションからデフォルト値を取得する必要あり
+ $this->arrDelivTime = $objPurchase->getDelivTime($deliv_id);
+ $this->img_show = $this->lfGetImgShow($this->arrPayment);
+ }
break;
}
- // 支払い方法の画像があるなしを取得($img_show true:ある false:なし)
- $this->img_show = $this->lfGetImgShow($this->arrPayment);
- // お届け日一覧の取得
- $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $this->cartKey);
+ // モバイル用 ポストバック処理
+ if (SC_Display::detectDevice() == DEVICE_TYPE_MOBILE) {
+ switch($this->getMode()) {
+ case 'select_deliv':
+ $this->tpl_mainpage = 'shopping/payment.tpl';
+ break;
+
+ case 'confirm':
+ case 'return':
+ default:
+ if ($this->is_single_deliv) {
+ $this->tpl_mainpage = 'shopping/payment.tpl';
+ } else {
+ $this->tpl_mainpage = 'shopping/select_deliv.tpl';
+ }
+ }
+ }
+
$this->arrForm = $this->objFormParam->getFormParamList();
}
@@ -204,15 +263,19 @@
}
/* パラメータ情報の初期化 */
- function lfInitParam() {
- $this->objFormParam->addParam("お支払い方法", "payment_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
- $this->objFormParam->addParam("ポイント", "use_point", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK", "ZERO_START"));
- $this->objFormParam->addParam("その他お問い合わせ", "message", LTEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
- $this->objFormParam->addParam("ポイントを使用する", "point_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), '2');
+ function lfInitParam($deliv_only = false) {
+ $this->objFormParam->addParam("配送業者", "deliv_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
- for ($i = 0; $i < count($this->shipping); $i++) {
- $this->objFormParam->addParam("お届け時間", "deliv_time_id" . $i, INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
- $this->objFormParam->addParam("お届け日", "deliv_date" . $i, STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
+ if (!$deliv_only) {
+ $this->objFormParam->addParam("お支払い方法", "payment_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
+ $this->objFormParam->addParam("ポイント", "use_point", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK", "ZERO_START"));
+ $this->objFormParam->addParam("その他お問い合わせ", "message", LTEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
+ $this->objFormParam->addParam("ポイントを使用する", "point_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), '2');
+
+ for ($i = 0; $i < count($this->shipping); $i++) {
+ $this->objFormParam->addParam("お届け時間", "deliv_time_id" . $i, INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
+ $this->objFormParam->addParam("お届け日", "deliv_date" . $i, STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
+ }
}
}
変更: branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_mysql.sql 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/html/install/sql/create_table_mysql.sql 2011-02-07 15:39:38 UTC (rev 20112)
@@ -623,7 +623,8 @@
order_job int,
subtotal numeric,
discount numeric,
- deliv_fee numeric,
+ deliv_id int,
+ deliv_fee numeric,
charge numeric,
use_point numeric,
add_point numeric,
@@ -679,6 +680,7 @@
order_job int,
subtotal numeric,
discount numeric,
+ deliv_id int,
deliv_fee numeric,
charge numeric,
use_point numeric,
変更: branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql 2011-02-07 06:13:47 UTC (rev 20111)
+++ branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql 2011-02-07 15:39:38 UTC (rev 20112)
@@ -623,6 +623,7 @@
order_job int,
subtotal numeric,
discount numeric,
+ deliv_id int,
deliv_fee numeric,
charge numeric,
use_point numeric,
@@ -679,6 +680,7 @@
order_job int,
subtotal numeric,
discount numeric,
+ deliv_id int,
deliv_fee numeric,
charge numeric,
use_point numeric,
Svn-src-all メーリングリストの案内