Ignore:
Timestamp:
2009/06/06 03:19:45 (15 years ago)
Author:
Seasoft
Message:

・店舗基本情報の取得処理にランタイムのキャッシュ機構を設け、店舗基本情報を深く渡し回す実装を改めた。
・SC_Utils 冒頭のコメントに従い、インスタンスを生成していた処理を、Helper クラスへ移す。計算処理のみ SC_Utils に残す。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/SC_CartSession.php

    r17970 r18052  
    9090    } 
    9191 
    92     // 商品ごとの合計価格 
    93     function getProductTotal($arrInfo, $id) { 
     92    /** 
     93     * 商品ごとの合計価格 
     94     * XXX 実際には、「商品」ではなく、「カートの明細行(≒商品規格)」のような気がします。 
     95     * 
     96     * @param integer $id 
     97     * @return string 商品ごとの合計価格(税込み) 
     98     */ 
     99    function getProductTotal($id) { 
    94100        $max = $this->getMax(); 
    95101        for($i = 0; $i <= $max; $i++) { 
     
    100106                $price = $_SESSION[$this->key][$i]['price']; 
    101107                $quantity = $_SESSION[$this->key][$i]['quantity']; 
    102                 $pre_tax = SC_Utils_Ex::sfPreTax($price, $arrInfo['tax'], $arrInfo['tax_rule']); 
     108                $pre_tax = SC_Helper_DB_Ex::sfPreTax($price); 
    103109                $total = $pre_tax * $quantity; 
    104110                return $total; 
     
    148154 
    149155    // 全商品の合計価格 
    150     function getAllProductsTotal($arrInfo) { 
     156    function getAllProductsTotal() { 
    151157        // 税込み合計 
    152158        $total = 0; 
     
    164170            $quantity = $_SESSION[$this->key][$i]['quantity']; 
    165171 
    166             $pre_tax = SC_Utils::sfPreTax($price, $arrInfo['tax'], $arrInfo['tax_rule']); 
     172            $pre_tax = SC_Helper_DB_Ex::sfPreTax($price); 
    167173            $total+= ($pre_tax * $quantity); 
    168174        } 
     
    171177 
    172178    // 全商品の合計税金 
    173     function getAllProductsTax($arrInfo) { 
     179    function getAllProductsTax() { 
    174180        // 税合計 
    175181        $total = 0; 
     
    178184            $price = $_SESSION[$this->key][$i]['price']; 
    179185            $quantity = $_SESSION[$this->key][$i]['quantity']; 
    180             $tax = SC_Utils_Ex::sfTax($price, $arrInfo['tax'], $arrInfo['tax_rule']); 
     186            $tax = SC_Helper_DB_Ex::sfTax($price); 
    181187            $total+= ($tax * $quantity); 
    182188        } 
Note: See TracChangeset for help on using the changeset viewer.