Changeset 22608


Ignore:
Timestamp:
2013/03/06 16:46:31 (11 years ago)
Author:
shutta
Message:

#2174 (商品をカゴに投入してカートに移動すると、開いていたカテゴリーツリーが閉じる)
商品詳細ページから商品をカゴに入れた際、および、カゴの中ページでの数量変更・商品削除の際に、開いているカテゴリーツリーを維持するように修正。

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

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/Smarty/templates/default/cart/index.tpl

    r22579 r22608  
    7676                        <input type="hidden" name="cartKey" value="<!--{$key|h}-->" /> 
    7777                        <input type="hidden" name="category_id" value="<!--{$tpl_category_id|h}-->" /> 
     78                        <input type="hidden" name="product_id" value="<!--{$tpl_product_id|h}-->" /> 
    7879                        <!--{if count($cartKeys) > 1}--> 
    7980                            <h3><!--{$arrProductType[$key]|h}--></h3> 
  • branches/version-2_12-dev/data/class/pages/cart/LC_Page_Cart.php

    r22604 r22608  
    108108        } 
    109109 
     110        $objFormParam4OpenCategoryTree = 
     111            $this->lfInitParam4OpenCategoryTree($_REQUEST); 
     112        if ($objFormParam4OpenCategoryTree->getValue('product_id')) { 
     113            $arrQueryString = array( 
     114                'product_id' => $objFormParam4OpenCategoryTree->getValue( 
     115                    'product_id'), 
     116            ); 
     117        } else { 
     118            $arrQueryString = array( 
     119                'category_id' => $objFormParam4OpenCategoryTree->getValue( 
     120                    'category_id'), 
     121            ); 
     122        } 
     123 
    110124        switch ($this->mode) { 
    111125            case 'confirm': 
     
    126140                $objCartSess->upQuantity($cart_no, $cartKey); 
    127141 
    128  
    129                 SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); 
     142                SC_Response_Ex::reload($arrQueryString, true); 
    130143                SC_Response_Ex::actionExit(); 
    131144                break; 
     
    133146                $objCartSess->downQuantity($cart_no, $cartKey); 
    134147 
    135  
    136                 SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); 
     148                SC_Response_Ex::reload($arrQueryString, true); 
    137149                SC_Response_Ex::actionExit(); 
    138150                break; 
     
    140152                $objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey); 
    141153 
    142  
    143                 SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); 
     154                SC_Response_Ex::reload($arrQueryString, true); 
    144155                SC_Response_Ex::actionExit(); 
    145156                break; 
     
    147158                $objCartSess->delProduct($cart_no, $cartKey); 
    148159 
    149  
    150                 SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); 
     160                SC_Response_Ex::reload($arrQueryString, true); 
    151161                SC_Response_Ex::actionExit(); 
    152162                break; 
     
    177187        $this->tpl_all_total_inctax = $totalIncTax; 
    178188 
    179         $this->tpl_category_id = $objFormParam->getValue('category_id'); 
     189        $this->tpl_category_id = 
     190            $objFormParam4OpenCategoryTree->getValue('category_id'); 
     191        $this->tpl_product_id = 
     192            $objFormParam4OpenCategoryTree->getValue('product_id'); 
    180193 
    181194        // ログイン判定 
     
    217230        $objFormParam->addParam('カートキー', 'cartKey', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 
    218231        $objFormParam->addParam('カートナンバー', 'cart_no', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
    219         // PC版での値引き継ぎ用 
    220         $objFormParam->addParam('カテゴリID', 'category_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
    221232        // スマートフォン版での数量変更用 
    222233        $objFormParam->addParam('数量', 'quantity', INT_LEN, 'n', array('ZERO_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     234        // 値の取得 
     235        $objFormParam->setParam($arrRequest); 
     236        // 入力値の変換 
     237        $objFormParam->convParam(); 
     238        return $objFormParam; 
     239    } 
     240 
     241    /** 
     242     * PC版での開いているカテゴリーツリーの維持用の入力値 
     243     * 
     244     * @return object 
     245     */ 
     246    function lfInitParam4OpenCategoryTree($arrRequest) 
     247    { 
     248        $objFormParam = new SC_FormParam_Ex(); 
     249 
     250        $objFormParam->addParam('カテゴリID', 'category_id', INT_LEN, 'n', 
     251            array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     252        $objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', 
     253            array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     254 
    223255        // 値の取得 
    224256        $objFormParam->setParam($arrRequest); 
  • branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r22567 r22608  
    517517            $objCartSess->addProduct($product_class_id, $this->objFormParam->getValue('quantity')); 
    518518 
    519  
    520             SC_Response_Ex::sendRedirect(CART_URLPATH); 
     519            // 開いているカテゴリーツリーを維持するためのパラメーター 
     520            $arrQueryString = array( 
     521                'product_id' => $this->objFormParam->getValue('product_id'), 
     522            ); 
     523 
     524            SC_Response_Ex::sendRedirect(CART_URLPATH, $arrQueryString); 
    521525            SC_Response_Ex::actionExit(); 
    522526        } 
Note: See TracChangeset for help on using the changeset viewer.