Changeset 21650 for branches/version-2_12-dev
- Timestamp:
- 2012/03/16 14:47:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CartSession.php
r21644 r21650 341 341 342 342 // 商品情報は常に取得 343 // TODO 同一インスタンス内では1回のみ呼ぶようにしたい 343 344 $this->cartSession[$productTypeId][$i]['productsClass'] 344 345 =& $objProduct->getDetailAndProductsClass($this->cartSession[$productTypeId][$i]['id']); … … 514 515 * 4. 在庫数チェック 515 516 * 516 * @param string $ key商品種別ID517 * @param string $productTypeId 商品種別ID 517 518 * @return string エラーが発生した場合はエラーメッセージ 518 519 */ … … 522 523 523 524 // カート内の情報を取得 524 $items = $this->getCartList($productTypeId); 525 foreach (array_keys($items) as $key) { 526 $item =& $items[$key]; 527 $product =& $item['productsClass']; 525 $arrItems = $this->getCartList($productTypeId); 526 foreach ($arrItems as &$arrItem) { 527 $product =& $arrItem['productsClass']; 528 528 /* 529 529 * 表示/非表示商品のチェック 530 530 */ 531 531 if (SC_Utils_Ex::isBlank($product) || $product['status'] != 1) { 532 $this->delProduct($ item['cart_no'], $productTypeId);532 $this->delProduct($arrItem['cart_no'], $productTypeId); 533 533 $tpl_message .= "※ 現時点で販売していない商品が含まれておりました。該当商品をカートから削除しました。\n"; 534 534 } else { … … 541 541 $tpl_message .= '※「' . $product['name'] . '」はまだ配送の準備ができておりません。'; 542 542 $tpl_message .= '恐れ入りますがお問い合わせページよりお問い合わせください。' . "\n"; 543 $this->delProduct($ item['cart_no'], $productTypeId);543 $this->delProduct($arrItem['cart_no'], $productTypeId); 544 544 } 545 545 … … 548 548 */ 549 549 $limit = $objProduct->getBuyLimit($product); 550 if (!is_null($limit) && $ item['quantity'] > $limit) {550 if (!is_null($limit) && $arrItem['quantity'] > $limit) { 551 551 if ($limit > 0) { 552 $this->setProductValue($ item['id'], 'quantity', $limit, $productTypeId);553 $total_inctax = SC_Helper_DB_Ex::sfCalcIncTax($ item['price']) * $limit;554 $this->setProductValue($ item['id'], 'total_inctax', $total_inctax, $productTypeId);552 $this->setProductValue($arrItem['id'], 'quantity', $limit, $productTypeId); 553 $total_inctax = SC_Helper_DB_Ex::sfCalcIncTax($arrItem['price']) * $limit; 554 $this->setProductValue($arrItem['id'], 'total_inctax', $total_inctax, $productTypeId); 555 555 $tpl_message .= '※「' . $product['name'] . '」は販売制限(または在庫が不足)しております。'; 556 556 $tpl_message .= "一度に数量{$limit}を超える購入はできません。\n"; 557 557 } else { 558 $this->delProduct($ item['cart_no'], $productTypeId);558 $this->delProduct($arrItem['cart_no'], $productTypeId); 559 559 $tpl_message .= '※「' . $product['name'] . "」は売り切れました。\n"; 560 560 continue; … … 590 590 $arrInfo = $objDb->sfGetBasisData(); 591 591 if ($arrInfo['free_rule'] > 0) { 592 // 小計が 無料条件を超えている場合592 // 小計が送料無料条件以上の場合 593 593 if ($subtotal >= $arrInfo['free_rule']) { 594 594 return true; … … 633 633 if (OPTION_PRODUCT_DELIV_FEE == 1) { 634 634 $cartItems = $this->getCartList($productTypeId); 635 foreach ($cartItems as $ item) {636 $results['deliv_fee'] += $ item['productsClass']['deliv_fee'] * $item['quantity'];635 foreach ($cartItems as $arrItem) { 636 $results['deliv_fee'] += $arrItem['productsClass']['deliv_fee'] * $arrItem['quantity']; 637 637 } 638 638 }
Note: See TracChangeset
for help on using the changeset viewer.