Changeset 21006


Ignore:
Timestamp:
2011/07/02 21:20:34 (10 years ago)
Author:
Seasoft
Message:

#1361 (お届け先の複数指定 実際に配送で使わないお届け先も保持される(非会員))
#1368 (お届け先の複数指定 配送先変更のはずが配送先と注文数が増える)
#1386 (「お届け先の複数指定」か否かに関わらず、配送商品を登録する)

Location:
branches/version-2_11-dev/data/class
Files:
4 edited

Legend:

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

    r20975 r21006  
    7575        $orderId = $this->registerOrderComplete($orderTemp, $objCartSession, 
    7676                                                $cartkey); 
    77         $shippingTemp =& $this->getShippingTemp(); 
    78         if (count($shippingTemp) > 1) { 
    79             foreach ($shippingTemp as $shippingId => $val) { 
    80                 $this->registerShipmentItem($orderId, $shippingId, 
    81                                             $val['shipment_item']); 
    82             } 
     77        $shippingTemp =& $this->getShippingTemp(true); 
     78        foreach ($shippingTemp as $shippingId => $val) { 
     79            $this->registerShipmentItem($orderId, $shippingId, 
     80                                        $val['shipment_item']); 
    8381        } 
    8482 
     
    282280 
    283281    /** 
    284      * セッションの配送情報を取得する. 
    285      */ 
    286     function getShippingTemp() { 
     282     * 配送情報をセッションから取得する. 
     283     * 
     284     * @param bool $has_shipment_item 配送商品を保有している配送先のみ返す。 
     285     */ 
     286    function getShippingTemp($has_shipment_item) { 
     287        if ($has_shipment_item) { 
     288            $arrReturn = array(); 
     289            foreach ($_SESSION['shipping'] as $key => $arrVal) { 
     290                if (count($arrVal['shipment_item']) == 0) continue; 
     291                $arrReturn[$key] = $arrVal; 
     292            } 
     293            return $arrReturn; 
     294        } 
     295 
    287296        return $_SESSION['shipping']; 
    288297    } 
     
    342351    function getShippingPref() { 
    343352        $results = array(); 
    344         foreach ($_SESSION['shipping'] as $val) { 
     353        foreach (SC_Helper_Purchase_Ex::getShippingTemp(true) as $val) { 
    345354            $results[] = $val['shipping_pref']; 
    346355        } 
     
    354363     */ 
    355364    function isMultiple() { 
    356         return count($this->getShippingTemp()) > 1; 
     365        return count(SC_Helper_Purchase_Ex::getShippingTemp(true)) > 1; 
    357366    } 
    358367 
     
    364373     * @return void 
    365374     */ 
    366     function saveShippingTemp(&$arrSrc, $shipping_id = 0) { 
     375    function saveShippingTemp($arrSrc, $shipping_id = 0) { 
     376        // 配送商品は引き継がない 
     377        unset($arrSrc['shipment_item']); 
     378 
    367379        if (empty($_SESSION['shipping'][$shipping_id])) { 
    368380            $_SESSION['shipping'][$shipping_id] = $arrSrc; 
     
    649661        $objQuery->delete($table, $where, array($order_id)); 
    650662 
    651          foreach ($arrParams as $key => $arrShipping) { 
     663        foreach ($arrParams as $key => $arrShipping) { 
    652664 
    653665            $arrValues = $objQuery->extractOnlyColsOf($table, $arrShipping); 
  • branches/version-2_11-dev/data/class/pages/shopping/LC_Page_Shopping_Confirm.php

    r20820 r21006  
    9999 
    100100        // カートの商品を取得 
    101         $this->arrShipping = $objPurchase->getShippingTemp(); 
     101        $this->arrShipping = $objPurchase->getShippingTemp(true); 
    102102        $this->arrCartItems = $objCartSess->getCartList($this->cartKey); 
    103103        // 合計金額 
  • branches/version-2_11-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php

    r20984 r21006  
    283283        $objPurchase->clearShipmentItemTemp(); 
    284284 
     285        foreach ($arrValues as $shipping_id => $arrVal) { 
     286            $objPurchase->saveShippingTemp($arrVal, $shipping_id); 
     287        } 
     288 
    285289        foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) { 
    286290            foreach ($arrProductClassIds as $product_class_id => $quantity) { 
     
    291295        } 
    292296 
    293         foreach ($arrValues as $shipping_id => $val) { 
    294             $objPurchase->saveShippingTemp($val, $shipping_id); 
    295         } 
    296  
    297297        // $arrValues[0] には, 購入者の情報が格納されている 
    298298        $objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer); 
  • branches/version-2_11-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php

    r20970 r21006  
    8282 
    8383        // カートの情報を取得 
    84         $this->arrShipping =& $objPurchase->getShippingTemp(); 
     84        $this->arrShipping =& $objPurchase->getShippingTemp(true); 
    8585 
    8686        $this->is_multiple = $objPurchase->isMultiple(); 
Note: See TracChangeset for help on using the changeset viewer.