Changeset 21925 for branches/version-2_12-dev/data/class/SC_CartSession.php
- Timestamp:
- 2012/06/19 16:15:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CartSession.php
r21920 r21925 51 51 } 52 52 // 1世代古いコピー情報は、削除しておく 53 foreach ( $_SESSION as $k => $val) {53 foreach (array_keys($_SESSION) as $k) { 54 54 if ($k != $this->key_tmp && preg_match('/^savecart_/', $k)) { 55 55 unset($this->cartSession[$productTypeId][$k]); … … 87 87 // 一時カートのクリア 88 88 unset($_SESSION[$this->key_tmp]); 89 $this->cartSession[$productTypeId][ $key]['cancel_purchase'] = true;89 $this->cartSession[$productTypeId]['cancel_purchase'] = true; 90 90 } else { 91 91 $this->cartSession[$productTypeId]['cancel_purchase'] = false; … … 96 96 // 次に割り当てるカートのIDを取得する 97 97 function getNextCartID($productTypeId) { 98 foreach ($this->cartSession[$productTypeId] as $key => $val) { 99 $arrRet[] = $this->cartSession[$productTypeId][$key]['cart_no']; 100 } 101 return max($arrRet) + 1; 98 $count = array(); 99 foreach (array_keys($this->cartSession[$productTypeId]) as $key) { 100 $count[] = $this->cartSession[$productTypeId][$key]['cart_no']; 101 } 102 return max($count) + 1; 102 103 } 103 104 … … 143 144 $max = 0; 144 145 if (count($this->cartSession[$productTypeId]) > 0) { 145 foreach ( $this->cartSession[$productTypeId] as $key => $val) {146 foreach (array_keys($this->cartSession[$productTypeId]) as $key) { 146 147 if (is_numeric($key)) { 147 148 if ($max < $key) { … … 393 394 function getAllProductID($productTypeId) { 394 395 $max = $this->getMax($productTypeId); 396 $productIDs = array(); 395 397 for ($i = 0; $i <= $max; $i++) { 396 398 if ($this->cartSession[$productTypeId][$i]['cart_no'] != '') { 397 $ arrRet[] = $this->cartSession[$productTypeId][$i]['id'][0];398 } 399 } 400 return $ arrRet;399 $productIDs[] = $this->cartSession[$productTypeId][$i]['id'][0]; 400 } 401 } 402 return $productIDs; 401 403 } 402 404 … … 409 411 function getAllProductClassID($productTypeId) { 410 412 $max = $this->getMax($productTypeId); 413 $productClassIDs = array(); 411 414 for ($i = 0; $i <= $max; $i++) { 412 415 if ($this->cartSession[$productTypeId][$i]['cart_no'] != '') { 413 $ arrRet[] = $this->cartSession[$productTypeId][$i]['id'];414 } 415 } 416 return $ arrRet;416 $productClassIDs[] = $this->cartSession[$productTypeId][$i]['id']; 417 } 418 } 419 return $productClassIDs; 417 420 } 418 421 … … 497 500 */ 498 501 function getProductClassId($cart_no, $productTypeId) { 499 for ($i = 0; $i < = $max; $i++) {502 for ($i = 0; $i < count($this->cartSession[$productTypeId]); $i++) { 500 503 if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) { 501 504 return $this->cartSession[$productTypeId][$i]['id']; … … 625 628 ) { 626 629 630 $results = array(); 627 631 $total_point = $this->getAllProductsPoint($productTypeId); 628 632 $results['tax'] = $this->getAllProductsTax($productTypeId);
Note: See TracChangeset
for help on using the changeset viewer.