Changeset 20877


Ignore:
Timestamp:
2011/04/21 11:52:40 (13 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20110421012628-mb15vfnb88s230b0
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/SC_CartSession.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_CartSession.php
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110421025206-690rqlkhnjhaw3qp
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110421025237-8ptnnm38grhmet7a
bzr:revno:
3588
bzr:revprop:branch-nick:
branches/version-2_11-dev
bzr:root:
branches/version-2_11-dev
bzr:text-revisions:

data/class/SC_CartSession.php ohkouchi@loop-az.jp-20110421025206-690rqlkhnjhaw3qp
data/class/SC_Product.php ohkouchi@loop-az.jp-20110421025206-690rqlkhnjhaw3qp
bzr:timestamp:
2011-04-21 11:52:37.161000013 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-04-21T02:52:37.161000Z
Message:

#1237 (商品に個別に設定した送料が反映されない)

  • カートに商品投入後, 商品送料を設定しても反映されないため, SC_CartSession の商品情報はリアルタイムに取得するよう修正
Location:
branches/version-2_11-dev/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/SC_CartSession.php

    r20849 r20877  
    2222 */ 
    2323 
    24 /* カートセッション管理クラス */ 
     24/** 
     25 * カートセッション管理クラス 
     26 * 
     27 * @author LOCKON CO.,LTD. 
     28 * @version $Id$ 
     29 */ 
    2530class SC_CartSession { 
    2631    /** ユニークIDを指定する. */ 
     
    290295    } 
    291296 
     297    /** 
     298     * 商品種別ごとにカート内商品の一覧を取得する. 
     299     * 
     300     * @param integer $productTypeId 商品種別ID 
     301     * @return array カート内商品一覧の配列 
     302     */ 
    292303    function getCartList($productTypeId) { 
    293304        $objProduct = new SC_Product_Ex(); 
     
    298309               && $this->cartSession[$productTypeId][$i]['cart_no'] != "") { 
    299310 
    300                 if (SC_Utils_Ex::isBlank($this->cartSession[$productTypeId][$i]['productsClass'])) { 
    301                     $this->cartSession[$productTypeId][$i]['productsClass'] =& 
    302                             $objProduct->getDetailAndProductsClass( 
     311                // 商品情報は常に取得 
     312                $this->cartSession[$productTypeId][$i]['productsClass'] =& 
     313                        $objProduct->getDetailAndProductsClass( 
    303314                                    $this->cartSession[$productTypeId][$i]['id']); 
    304                 } 
    305315 
    306316                $price = $this->cartSession[$productTypeId][$i]['productsClass']['price02']; 
     
    343353 
    344354    // カート内にある商品IDを全て取得する 
     355    /** 
     356     * @deprected getAllProductClassID を使用して下さい 
     357     */ 
    345358    function getAllProductID($productTypeId) { 
    346359        $max = $this->getMax($productTypeId); 
     
    369382    } 
    370383 
     384    /** 
     385     * 商品種別ID を指定して, カート内の商品をすべて削除する. 
     386     * 
     387     * @param integer $productTypeId 商品種別ID 
     388     * @return void 
     389     */ 
    371390    function delAllProducts($productTypeId) { 
    372391        $max = $this->getMax($productTypeId); 
     
    402421    } 
    403422 
     423    /** 
     424     * カート番号と商品種別IDを指定して, 数量を取得する. 
     425     * 
     426     * @param integer $cart_no カート番号 
     427     * @param integer $productTypeId 商品種別ID 
     428     * @return integer 該当商品規格の数量 
     429     */ 
    404430    function getQuantity($cart_no, $productTypeId) { 
    405431        $max = $this->getMax($productTypeId); 
     
    411437    } 
    412438 
     439    /** 
     440     * カート番号と商品種別IDを指定して, 数量を設定する. 
     441     * 
     442     * @param integer $quantity 設定する数量 
     443     * @param integer $cart_no カート番号 
     444     * @param integer $productTypeId 商品種別ID 
     445     * @retrun void 
     446     */ 
    413447    function setQuantity($quantity, $cart_no, $productTypeId) { 
    414448        $max = $this->getMax($productTypeId); 
     
    420454    } 
    421455 
     456    /** 
     457     * カート番号と商品種別IDを指定して, 商品規格IDを取得する. 
     458     * 
     459     * @param integer $cart_no カート番号 
     460     * @param integer $productTypeId 商品種別ID 
     461     * @return integer 商品規格ID 
     462     */ 
    422463    function getProductClassId($cart_no, $productTypeId) { 
    423464        for ($i = 0; $i <= $max; $i++) { 
     
    526567     * - tax: 税額 
    527568     * - subtotal: カート内商品の小計 
    528      * - deliv_fee: カート内商品の合計送料 FIXME 
     569     * - deliv_fee: カート内商品の合計送料 
    529570     * - total: 合計金額 
    530571     * - payment_total: お支払い合計 
    531572     * - add_point: 加算ポイント 
    532      * 
    533      *  TODO ダウンロード商品のみの場合の送料を検討する 
    534      *  TODO 使用ポイント, 配送都道府県, 支払い方法, 手数料の扱いを検討 
    535573     * 
    536574     * @param integer $productTypeId 商品種別ID 
     
    557595            $cartItems = $this->getCartList($productTypeId); 
    558596            foreach ($cartItems as $item) { 
    559                 $results['deliv_fee'] += $item['deliv_fee'] * $item['quantity']; 
     597                $results['deliv_fee'] += $item['productsClass']['deliv_fee'] * $item['quantity']; 
    560598            } 
    561599        } 
     
    600638    } 
    601639 
     640    /** 
     641     * カートが保持するキー(商品種別ID)を配列で返す. 
     642     * 
     643     * @return array 商品種別IDの配列 
     644     */ 
    602645    function getKeys() { 
    603646        $keys = array_keys($this->cartSession); 
     
    612655    } 
    613656 
     657    /** 
     658     * カートに設定された現在のキー(商品種別ID)を登録する. 
     659     * 
     660     * @param integer $key 商品種別ID 
     661     * @return void 
     662     */ 
    614663    function registerKey($key) { 
    615664        $_SESSION['cartKey'] = $key; 
    616665    } 
    617666 
     667    /** 
     668     * カートに設定された現在のキー(商品種別ID)を削除する. 
     669     * 
     670     * @return void 
     671     */ 
    618672    function unsetKey() { 
    619673        unset($_SESSION['cartKey']); 
    620674    } 
    621675 
     676    /** 
     677     * カートに設定された現在のキー(商品種別ID)を取得する. 
     678     * 
     679     * @return integer 商品種別ID 
     680     */ 
    622681    function getKey() { 
    623682        return $_SESSION['cartKey']; 
  • branches/version-2_11-dev/data/class/SC_Product.php

    r20790 r20877  
    615615        } 
    616616        /* 
    617          * point_rate は商品規格(dtb_products_class)ごとに保持しているが, 
     617         * point_rate, deliv_fee は商品規格(dtb_products_class)ごとに保持しているが, 
    618618         * 商品(dtb_products)ごとの設定なので MAX のみを取得する. 
    619619         */ 
     
    676676                    T4.stock_unlimited_max, 
    677677                    T4.point_rate, 
     678                    T4.deliv_fee, 
    678679                    T4.class_count 
    679680               FROM dtb_products 
     
    691692                              MAX(stock_unlimited) AS stock_unlimited_max, 
    692693                              MAX(point_rate) AS point_rate, 
     694                              MAX(deliv_fee) AS deliv_fee, 
    693695                              COUNT(*) as class_count 
    694696                         FROM dtb_products_class 
Note: See TracChangeset for help on using the changeset viewer.