Changeset 18609 for tmp/version-2_5-test/data/class/SC_CartSession.php
- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/class/SC_CartSession.php
r17465 r18609 90 90 } 91 91 92 // 商品ごとの合計価格 93 function getProductTotal($arrInfo, $id) { 92 /** 93 * 商品ごとの合計価格 94 * XXX 実際には、「商品」ではなく、「カートの明細行(≒商品規格)」のような気がします。 95 * 96 * @param integer $id 97 * @return string 商品ごとの合計価格(税込み) 98 */ 99 function getProductTotal($id) { 94 100 $max = $this->getMax(); 95 101 for($i = 0; $i <= $max; $i++) { … … 100 106 $price = $_SESSION[$this->key][$i]['price']; 101 107 $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); 103 109 $total = $pre_tax * $quantity; 104 110 return $total; … … 148 154 149 155 // 全商品の合計価格 150 function getAllProductsTotal( $arrInfo) {156 function getAllProductsTotal() { 151 157 // 税込み合計 152 158 $total = 0; … … 164 170 $quantity = $_SESSION[$this->key][$i]['quantity']; 165 171 166 $pre_tax = SC_ Utils::sfPreTax($price, $arrInfo['tax'], $arrInfo['tax_rule']);172 $pre_tax = SC_Helper_DB_Ex::sfPreTax($price); 167 173 $total+= ($pre_tax * $quantity); 168 174 } … … 171 177 172 178 // 全商品の合計税金 173 function getAllProductsTax( $arrInfo) {179 function getAllProductsTax() { 174 180 // 税合計 175 181 $total = 0; … … 178 184 $price = $_SESSION[$this->key][$i]['price']; 179 185 $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); 181 187 $total+= ($tax * $quantity); 182 188 } … … 188 194 // ポイント合計 189 195 $total = 0; 190 $max = $this->getMax(); 191 for($i = 0; $i <= $max; $i++) { 192 $price = $_SESSION[$this->key][$i]['price']; 193 $quantity = $_SESSION[$this->key][$i]['quantity']; 194 195 if (!isset($_SESSION[$this->key][$i]['point_rate'])) { 196 $_SESSION[$this->key][$i]['point_rate'] = ""; 197 } 198 $point_rate = $_SESSION[$this->key][$i]['point_rate']; 199 200 if (!isset($_SESSION[$this->key][$i]['id'][0])) { 201 $_SESSION[$this->key][$i]['id'][0] = ""; 202 } 203 $id = $_SESSION[$this->key][$i]['id'][0]; 204 $point = SC_Utils_Ex::sfPrePoint($price, $point_rate, POINT_RULE, $id); 205 $total+= ($point * $quantity); 196 if (USE_POINT !== false) { 197 $max = $this->getMax(); 198 for($i = 0; $i <= $max; $i++) { 199 $price = $_SESSION[$this->key][$i]['price']; 200 $quantity = $_SESSION[$this->key][$i]['quantity']; 201 202 if (!isset($_SESSION[$this->key][$i]['point_rate'])) { 203 $_SESSION[$this->key][$i]['point_rate'] = ""; 204 } 205 $point_rate = $_SESSION[$this->key][$i]['point_rate']; 206 207 if (!isset($_SESSION[$this->key][$i]['id'][0])) { 208 $_SESSION[$this->key][$i]['id'][0] = ""; 209 } 210 $id = $_SESSION[$this->key][$i]['id'][0]; 211 $point = SC_Utils_Ex::sfPrePoint($price, $point_rate, POINT_RULE, $id); 212 $total+= ($point * $quantity); 213 } 206 214 } 207 215 return $total; … … 241 249 // 前頁として記録しないページを指定する。 242 250 $arrExclude = array( 243 "detail_image.php",244 251 "/shopping/" 245 252 ); … … 322 329 } 323 330 324 // 個数の増加331 // 数量の増加 325 332 function upQuantity($cart_no) { 326 333 $max = $this->getMax(); … … 334 341 } 335 342 336 // 個数の減少343 // 数量の減少 337 344 function downQuantity($cart_no) { 338 345 $max = $this->getMax(); … … 342 349 $_SESSION[$this->key][$i]['quantity']--; 343 350 } 344 }345 }346 }347 348 // 全商品の合計送料349 function getAllProductsDelivFee() {350 // ポイント合計351 $total = 0;352 $max = $this->getMax();353 for($i = 0; $i <= $max; $i++) {354 $deliv_fee = $_SESSION[$this->key][$i]['deliv_fee'];355 $quantity = $_SESSION[$this->key][$i]['quantity'];356 $total+= ($deliv_fee * $quantity);357 }358 return $total;359 }360 361 // カートの中の売り切れチェック362 function chkSoldOut($arrCartList, $is_mobile = false){363 foreach($arrCartList as $key => $val){364 if($val['quantity'] == 0){365 // 売り切れ商品をカートから削除する366 $this->delProduct($val['cart_no']);367 SC_Utils_Ex::sfDispSiteError(SOLD_OUT, "", true, "", $is_mobile);368 351 } 369 352 }
Note: See TracChangeset
for help on using the changeset viewer.