Source for file LC_Page_Shopping_Payment.php
Documentation is available at LC_Page_Shopping_Payment.php
* 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.
require_once(CLASS_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id:LC_Page_Shopping_Payment.php 15532 2007-08-31 14:39:46Z nanasess $
$objDb = new SC_Helper_DB_Ex();
$objSiteInfo = $objView->objSiteInfo;
$arrInfo = $objSiteInfo->data;
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid = $uniqid;
$this->tpl_user_point = $this->objCustomer->getValue('point');
$this->tpl_back_url = URL_DELIV_TOP;
$this->tpl_back_url = URL_SHOP_TOP . "?from=nonmember";
$arrOrderTemp = $objDb->sfGetOrderTemp($uniqid);
//不正遷移チェック(正常に受注情報が格納されていない場合は一旦カート画面まで戻す)
// 金額の取得 (購入途中で売り切れた場合にはこの関数内にてその商品の個数が0になる)
$objDb->sfTotalCart($this, $objCartSess, $arrInfo);
if (empty($arrData)) $arrData = array();
$this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo);
$objCartSess->chkSoldOut($objCartSess->getCartList());
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if(count($this->arrErr) == 0) {
$objSiteSess->setRegistFlag();
$uniqid = $objSiteSess->getUniqId();
$objSiteSess->setRegistFlag();
// ここのbreakは、意味があるので外さないで下さい。
$arrInfo = $objSiteInfo->data;
$total_pretax = $objCartSess->getAllProductsTotal($arrInfo);
// 支払い方法の画像があるなしを取得($img_show true:ある false:なし)
$arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
$this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
$objView->assignobj($this);
// フレームを選択(キャンペーンページから遷移なら変更)
$objCampaignSess->pageView($objView);
$objDb = new SC_Helper_DB_Ex();
$objSiteInfo = $objView->objSiteInfo;
$arrInfo = $objSiteInfo->data;
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid = SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid = $uniqid;
$this->tpl_user_point = $this->objCustomer->getValue('point');
$arrOrderTemp = $objDb->sfGetOrderTemp($uniqid);
//不正遷移チェック(正常に受注情報が格納されていない場合は一旦カート画面まで戻す)
// 金額の取得 (購入途中で売り切れた場合にはこの関数内にてその商品の個数が0になる)
$objDb->sfTotalCart($this, $objCartSess, $arrInfo);
if (empty($arrData)) $arrData = array();
$this->arrData = $objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo);
$objCartSess->chkSoldOut($objCartSess->getCartList(), true);
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if (!empty($_POST['return'])) {
switch ($_POST['mode']) {
$_POST['mode'] = 'payment';
$objSiteSess->setRegistFlag();
if (!isset ($this->arrErr['payment_id'])) {
$uniqid = $objSiteSess->getUniqId();
if(count($this->arrErr) == 0) {
$objSiteSess->setRegistFlag();
$uniqid = $objSiteSess->getUniqId();
if (!isset ($this->arrErr['payment_id'])) {
$objSiteSess->setRegistFlag();
// ここのbreakは、意味があるので外さないで下さい。
$arrInfo = $objSiteInfo->data;
$total_pretax = $objCartSess->getAllProductsTotal($arrInfo);
$arrRet = $objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
$this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
$objView->assignobj($this);
$objView->display(SITE_FRAME);
$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("お届け時間", "deliv_time_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$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');
$this->objFormParam->addParam("お届け日", "deliv_date", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
$objQuery->setOrder("rank DESC");
$arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) ");
foreach($arrRet as $data) {
if($data['rule'] > 0 && $data['upper_rule'] > 0) {
if($data['rule'] <= $total_pretax && $data['upper_rule'] >= $total_pretax) {
} elseif($data['rule'] > 0) {
if($data['rule'] <= $total_pretax) {
} elseif($data['upper_rule'] > 0) {
if($data['upper_rule'] >= $total_pretax) {
if (USE_POINT === false) {
$_POST['point_check'] = "";
$_POST['use_point'] = "0";
if (!isset ($_POST['point_check'])) $_POST['point_check'] = "";
if($_POST['point_check'] == '1') {
$objErr->doFunc(array("ポイントを使用する", "point_check"), array("EXIST_CHECK"));
$objErr->doFunc(array("ポイント", "use_point"), array("EXIST_CHECK"));
// FIXME mobile 互換のため br は閉じない...
if($arrRet['use_point'] > $max_point) {
$objErr->arrErr['use_point'] = "※ ご利用ポイントが所持ポイントを超えています。<br>";
if(($arrRet['use_point'] * POINT_VALUE) > $arrData['subtotal']) {
$objErr->arrErr['use_point'] = "※ ご利用ポイントがご購入金額を超えています。<br>";
$objSiteInfo = $objView->objSiteInfo;
$arrInfo = $objSiteInfo->data;
$arrInfo = $objSiteInfo->data;
$total_pretax = $objCartSess->getAllProductsTotal($arrInfo);
foreach ($arrPayment as $key => $payment) {
if ($payment['payment_id'] == $arrRet['payment_id']) {
if ($pay_flag && $arrRet['payment_id'] != "" ) {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
$where = "payment_id = ?";
$arrRet = $objQuery->select("payment_method, charge", "dtb_payment", $where, array($payment_id));
return (array($arrRet[0]['payment_method'], $arrRet[0]['charge']));
$arrRet = $objQuery->select("deliv_id, deliv_time", "dtb_delivtime", $where, array($time_id));
return (array($arrRet[0]['deliv_id'], $arrRet[0]['deliv_time']));
$sqlval['order_temp_id'] = $uniqid;
$sqlval['update_date'] = 'Now()';
if($sqlval['payment_id'] != "") {
list ($sqlval['payment_method'], $sqlval['charge']) = $this->lfGetPaymentInfo($sqlval['payment_id']);
$sqlval['payment_id'] = '0';
$sqlval['payment_method'] = "";
if($sqlval['deliv_time_id'] != "") {
list ($sqlval['deliv_id'], $sqlval['deliv_time']) = $this->lfGetDelivTimeInfo($sqlval['deliv_time_id']);
$sqlval['deliv_time_id'] = '0';
$sqlval['deliv_id'] = '0';
$sqlval['deliv_time'] = "";
if($sqlval['point_check'] != '1') {
$sqlval['use_point'] = 0;
$objDb = new SC_Helper_DB_Ex();
$objDb->sfRegistTempOrder($uniqid, $sqlval);
$max = $objCartSess->getMax();
for($i = 1; $i <= $max; $i++ ) {
if($_SESSION[$objCartSess->key][$i]['id'][0] != "") {
$arrID['product_id'][$i] = $_SESSION[$objCartSess->key][$i]['id'][0];
if(count($arrID['product_id']) > 0) {
$id = implode(",", $arrID['product_id']);
$deliv_date = $objQuery->get("dtb_products", "MAX(deliv_date_id)", "product_id IN (". $id. ")");
//お届け可能日のスタート値から、お届け日の配列を取得する
$arrDelivDate = $this->lfGetDateArray($start_day, DELIV_DATE_END_MAX);
//お届け可能日のスタート値から、お届け日の配列を取得する
$arrWDAY = $masterData->getMasterData("mtb_wday");
$max_day = $start_day + $end_day;
for ($i = $start_day; $i < $max_day; $i++ ) {
$tmp_time = $now_time + ($i * 24 * 3600);
list ($y, $m, $d, $w) = split(" ", date("y m d w", $tmp_time));
$val = sprintf("%02d/%02d/%02d(%s)", $y, $m, $d, $arrWDAY[$w]);
$col = "payment_id, use_point, deliv_time_id, message, point_check, deliv_date";
$from = "dtb_order_temp";
$where = "order_temp_id = ?";
$arrRet = $objQuery->select($col, $from, $where, array($uniqid));
/* 支払い方法の画像があるなしを取得($img_show true:ある false:なし) */
foreach ($this->arrPayment as $payment) {
if (strlen($payment["payment_image"]) > 0 ){
Documentation generated on Fri, 24 Feb 2012 13:59:53 +0900 by Seasoft
|