Source for file LC_Page_Cart.php
Documentation is available at LC_Page_Cart.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 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_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Cart.php 21252 2011-09-22 08:48:32Z nanasess $
$this->tpl_title = "現在のカゴの中";
$masterData = new SC_DB_MasterData_Ex();
$this->arrProductType = $masterData->getMasterData("mtb_product_type");
$objCartSess = new SC_CartSession_Ex();
$objSiteSess = new SC_SiteSession_Ex();
$objCustomer = new SC_Customer_Ex();
$this->mode = $this->getMode();
$this->cartKeys = $objCartSess->getKeys();
foreach ($this->cartKeys as $key) {
if($objCartSess->getCancelPurchase($key)) {
$this->tpl_message = "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。";
$this->cartItems = & $objCartSess->getAllCartList();
$cart_no = $objFormParam->getValue('cart_no');
$cartKey = $objFormParam->getValue('cartKey');
$cartList = $objCartSess->getCartList($cartKey);
if(count($cartList) > 0) {
SC_Response_Ex::sendRedirect(SHOPPING_URL);
$objCartSess->upQuantity($cart_no, $cartKey);
SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
$objCartSess->downQuantity($cart_no, $cartKey);
SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
case 'setQuantity': //数量変更
$objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey);
SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
$objCartSess->delProduct($cart_no, $cartKey);
SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true);
$this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
$key = $this->cartKeys[$index];
$this->tpl_message = $objCartSess->checkProducts($key);
$this->tpl_total_inctax[$key] = $objCartSess->getAllProductsTotal($key);
$totalIncTax += $this->tpl_total_inctax[$key];
$this->tpl_total_tax[$key] = $objCartSess->getAllProductsTax($key);
$this->tpl_total_point[$key] = $objCartSess->getAllProductsPoint($key);
$this->arrData[$key] = $objCartSess->calculate($key, $objCustomer);
$this->arrData[$key]['is_deliv_free'] = $objCartSess->isDelivFree($key);
$this->tpl_deliv_free[$key] = $this->arrInfo['free_rule'] - $this->tpl_total_inctax[$key];
if (SC_Utils_Ex::isBlank($key)) {
unset ($this->cartKeys[$index]);
$this->tpl_all_total_inctax = $totalIncTax;
$this->tpl_category_id = $objFormParam->getValue('category_id');
if($objCustomer->isLoginSuccess(true)) {
$this->tpl_user_point = $objCustomer->getValue('point');
$this->tpl_name = $objCustomer->getValue('name01');
// TODO: SC_CartSession::setPrevURL()利用不可。
$this->tpl_prev_url = (isset ($_SESSION['cart_prev_url'])) ? $_SESSION['cart_prev_url'] : '';
$objFormParam = new SC_FormParam_Ex();
$objFormParam->addParam("カートキー", 'cartKey', INT_LEN, 'n', array('NUM_CHECK',"MAX_LENGTH_CHECK"));
$objFormParam->addParam("カートナンバー", "cart_no", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("カテゴリID", "category_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("数量", 'quantity', INT_LEN, 'n', array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->setParam($arrRequest);
$objFormParam->convParam();
$sqlval['order_temp_id'] = $uniqid;
$where = "order_temp_id = ?";
$objQuery = & SC_Query_Ex::getSingletonInstance();
$res = $objQuery->update("dtb_order_temp", $sqlval, $where, array($pre_uniqid));
if (!empty($session['cart_referer_url'])) {
$session['cart_prev_url'] = $session['cart_referer_url'];
unset ($session['cart_referer_url']);
$session['cart_prev_url'] = HTTPS_URL . 'entry/kiyaku.php';
$session['cart_prev_url'] = $referer;
if (!SC_Utils_Ex::sfIsInternalDomain($session['cart_prev_url'])) {
$session['cart_prev_url'] = '';
$objSiteSess->setRegistFlag();
$pre_uniqid = $objSiteSess->getUniqId();
$objSiteSess->setUniqId();
$uniqid = $objSiteSess->getUniqId();
// エラーリトライなどで既にuniqidが存在する場合は、設定を引き継ぐ
$objCartSess->registerKey($cartKey);
$objCartSess->saveCurrentCart($uniqid, $cartKey);
Documentation generated on Fri, 24 Feb 2012 14:01:54 +0900 by Seasoft
|