Changeset 18826


Ignore:
Timestamp:
2010/09/27 13:29:22 (10 years ago)
Author:
eccuore
Message:

#792(ダウンロード販売機能) カートに商品が入らない不具合修正

Location:
branches/version-2_5-dev/data/class
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Product.php

    r18824 r18826  
    459459        return $sql; 
    460460    } 
     461 
     462    /** 
     463     * 商品規格ID1、2に紐づいた,product_class_idを取得する. 
     464     * 
     465     * @param int $productId 商品ID 
     466     * @param int $classcategory_id1 商品規格ID1 
     467     * @param int $classcategory_id2 商品規格ID2 
     468     * @return string product_class_id 
     469     */ 
     470    function getClasscategoryIdsByProductClassId($productId, $classcategory_id1, $classcategory_id2) { 
     471        $objQuery = new SC_Query(); 
     472        $col = "T1.product_id AS product_id,T1.product_class_id AS product_class_id,T1.classcategory_id1 AS classcategory_id1,T1.classcategory_id2 AS classcategory_id2"; 
     473        $table = <<< __EOS__ 
     474            (SELECT 
     475                pc.product_code AS product_code, 
     476                pc.product_id AS product_id, 
     477                pc.product_class_id AS product_class_id, 
     478                pc.class_combination_id AS class_combination_id, 
     479                COALESCE(cc2.classcategory_id,0) AS classcategory_id1, 
     480                COALESCE(cc1.classcategory_id,0) AS classcategory_id2 
     481            FROM 
     482                dtb_products_class pc LEFT JOIN dtb_class_combination cc1 ON pc.class_combination_id = cc1.class_combination_id 
     483                LEFT JOIN dtb_class_combination cc2 ON cc1.parent_class_combination_id = cc2.class_combination_id) T1 
     484__EOS__; 
     485        $where = "T1.product_id = ? AND T1.classcategory_id1 = ? AND T1.classcategory_id2 = ?"; 
     486        $arrRet = $objQuery->select($col, $table, $where, 
     487                                    array($productId, $classcategory_id1, $classcategory_id2)); 
     488        return $arrRet[0]['product_class_id']; 
     489    } 
     490 
    461491} 
    462492?> 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r18824 r18826  
    189189                if (count($arrErr) == 0) { 
    190190                    $objCartSess = new SC_CartSession(); 
    191                     $product_class_id = $_POST['product_class_id']; 
    192191                    $classcategory_id1 = $_POST['classcategory_id1']; 
    193192                    $classcategory_id2 = $_POST['classcategory_id2']; 
     
    206205                        $classcategory_id2 = '0'; 
    207206                    } 
    208  
     207                    // 規格IDを取得 
     208                    $objProduct = new SC_Product(); 
     209                    $product_class_id = $objProduct->getClasscategoryIdsByProductClassId($_POST['product_id'],$classcategory_id1,$classcategory_id2); 
    209210                    $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 
    210211 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php

    r18824 r18826  
    145145            $arrErr = $this->lfCheckError($product_id); 
    146146            if (count($arrErr) == 0) { 
    147                 $product_class_id = $this->arrForm['product_class_id']; 
    148147                $classcategory_id1 = $this->arrForm['classcategory_id1']; 
    149148                $classcategory_id2 = $this->arrForm['classcategory_id2']; 
     
    156155                    $classcategory_id2 = '0'; 
    157156                } 
     157                // 規格IDを取得 
     158                $objProduct = new SC_Product(); 
     159                $product_class_id = $objProduct->getClasscategoryIdsByProductClassId($product_id,$classcategory_id1,$classcategory_id2); 
    158160                $objCartSess = new SC_CartSession(); 
    159161                $objCartSess->addProduct(array($product_id, $product_class_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']); 
Note: See TracChangeset for help on using the changeset viewer.