質問 > フロント機能 > カートにラジオボタンの項目を追加したい |
フロント機能
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
0201 |
投稿日時: 2018/5/18 17:25
対応状況: 開発中
|
新米 登録日: 2018/5/18 居住地: 投稿: 2 |
カートにラジオボタンの項目を追加したい ▼テンプレート
[EC-CUBE] 2.12.6 [OS] CentOS6 [PHP] 5.3.3 [データベース] MySQL 5.1.73 ●前提 ・list.tpl, detail.tpl などにラジオボタンを追加し、商品規格の一つを選択できるようにしています。 ・商品詳細画面(detail.tpl) にてラジオボタンのいずれかを選択した状態で商品をカートに入れると、規格が持つ情報に合わせて商品の価格を変動させるようにしたいです。 ●改修したソース ・LC_Page_Cart_Ex function lfInitParam($arrRequest) { <省略> // 追加項目 $objFormParam->addParam('各種プラン', 'plan_id', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK'));★ // 値の取得 $objFormParam->setParam($arrRequest); // 入力値の変換 $objFormParam->convParam(); return $objFormParam; } ・LC_Page_Products_Detail_Ex function doCart() { $this->arrErr = $this->lfCheckError($this->mode,$this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2); if (count($this->arrErr) == 0) { $objCartSess = new SC_CartSession_Ex(); $product_class_id = $this->objFormParam->getValue('product_class_id'); >objFormParam->getValue('quantity')); $objCartSess->addProduct($product_class_id, $this->objFormParam->getValue('quantity'), $this->objFormParam->getValue('plan_id'));★ SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } ・SC_CartSession_Ex function addProduct($product_class_id, $quantity, <省略> if (!$find) { $this->cartSession[$productTypeId][$max+1]['id'] = $product_class_id; $this->cartSession[$productTypeId][$max+1]['quantity'] = $quantity; $this->cartSession[$productTypeId][$max+1]['cart_no'] = $this->getNextCartID($productTypeId); $this->cartSession[$productTypeId][$max+1]['plan_id'] = $plan_id;★ } } function adjustSessionProductsClass(&$arrProductsClass) { $arrNecessaryItems = array( <省略> 'plan_id' => true, ); <省略> } ●問題 上記の状態で、規格「プラン」を持たない商品であれば、通常通りカートに追加されるのですが、規格「プラン」を持つ商品だとカートに追加されません。 どなたかご教示いただけないでしょうか。 |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |