バージョン選択

フォーラム

メニュー

オンライン状況

41 人のユーザが現在オンラインです。 (32 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 41
もっと...

サイト内検索

質問 > フロント機能 > 規格でない、商品について3つの選択肢から1つ選んでもらいたい

フロント機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
mizuvan
投稿日時: 2015/1/31 16:58
対応状況: −−−
長老
登録日: 2013/3/26
居住地:
投稿: 253
規格でない、商品について3つの選択肢から1つ選んでもらいたい
商品詳細ページでマスターデータ管理で登録した項目を表示させ

3つの項目からプルダウン形式で選んでもらえるような機能を追加したかったのですが

下記のようにテンプレートに追記したらエラーとなりました。

		        <select name="mtb_select" style="<!--{$arrErr.mtb_select|sfGetErrorColor}-->">
			<!--{html_options options=$arrClassCat1 selected= }-->
		        </select>
		        <!--{if $arrErr.mtb_select != ""}-->
		        <br /><span class="attention">※ <!--{$tpl_class_name1}-->をお選び下さい。</span>
		        <!--{/if}-->



カート部分に入れ、エラーログは下記の通りです。

引用:
2015/01/31 16:44:53 [/***/products/detail.php] Fatal error(E_USER_ERROR): Smarty error: [in ***/data/Smarty/templates/***/products/detail.tpl line 267]: syntax error: missing attribute value (Smarty_Compiler.class.php, line 1593) on [***/data/module/Smarty/libs/Smarty.class.php(1094)] from IPアドレス
customer_id = 1
***/products/detail.php(29): LC_Page_Products_Detail_Ex->process
***/data/class_extends/page_extends/products/LC_Page_Products_Detail_Ex.php(60): LC_Page_Products_Detail->process
***/data/class/pages/products/LC_Page_Products_Detail.php(91): LC_Page->sendResponse
***/data/class/pages/LC_Page.php(152): SC_Display->prepare
***/data/class/SC_Display.php(80): SC_View->getResponse
***/data/class/SC_View.php(101): Smarty->fetch
***/data/module/Smarty/libs/Smarty.class.php(1264): include
***/data/Smarty/templates_c/original/%%F1^F15^F158E3F4%%site_frame.tpl.php(177): Smarty->_smarty_include
***/data/module/Smarty/libs/Smarty.class.php(1870): include
***/data/Smarty/templates_c/original/%%58^587^5876E692%%site_main.tpl.php(39): Smarty->_smarty_include
***/data/module/Smarty/libs/Smarty.class.php(1868): Smarty->_compile_resource
***/data/module/Smarty/libs/Smarty.class.php(1423): Smarty->_compile_source
***/data/module/Smarty/libs/Smarty.class.php(1490): Smarty_Compiler->_compile_file
***/data/module/Smarty/libs/Smarty_Compiler.class.php(312): Smarty_Compiler->_compile_tag
***/data/module/Smarty/libs/Smarty_Compiler.class.php(587): Smarty_Compiler->_compile_custom_tag
***/data/module/Smarty/libs/Smarty_Compiler.class.php(814): Smarty_Compiler->_parse_attrs
***/data/module/Smarty/libs/Smarty_Compiler.class.php(1593): Smarty_Compiler->_syntax_error
***/data/module/Smarty/libs/Smarty_Compiler.class.php(2256): Smarty->_trigger_fatal_error
***/data/module/Smarty/libs/Smarty.class.php(1816): Smarty->trigger_error
***/data/module/Smarty/libs/Smarty.class.php(1094): trigger_error


----------------

yuh
投稿日時: 2015/2/1 13:05
対応状況: −−−
登録日: 2013/1/9
居住地: 大阪
投稿: 1819
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
テンプレートのエラーですね
mizuvan
投稿日時: 2015/2/5 17:20
対応状況: −−−
長老
登録日: 2013/3/26
居住地:
投稿: 253
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
yuh様、ありがとうございます!

テンプレートどころか、もともとPHP側に設定を全くしていなかったことに気付きました。

その後、下記のようなカスタマイズをしました。
dtb_orderと dtb_order_tempテーブルにカラム追加
data/class/pages/products/LC_Page_Products_Detail.php
data/class/pages/shopping/LC_Page_Shopping_Confirm.php
data/class/SC_CartSession.php

その中でどうもわからないものが、SC_CartSession.phpでエラーが出てしまいます、

エラー内容が下記のようなもので
引用:
Fatal error(E_PARSE): syntax error, unexpected '';' (T_CONSTANT_ENCAPSED_STRING) on


そこに、/data/class/SC_CartSession.php(790)とありました。

     * @param  integer $key 商品種別ID
     * @return void
     */
    public function registerKey($key)
    {
        $_SESSION['cartKey'] = $key;
    }

エラーログから、上記部分がと出てくるのですがどうすればよいものか検討がつきませんでした。

T_CONSTANT_ENCAPSED_STRING というエラー内容が全角の文字、もしくはスペースが入っている場合となっているようなのです・・一切この部分は弄ってはいなく・・・

SC_CartSession.phpのカスタマイズ内容は下記の通りなのですが何かしらアドバイスいただけないでしょうか

    // カートへの商品追加
    public function addProduct($product_class_id, $quantity, $label_select)
    {
        $objProduct = new SC_Product_Ex();
        $arrProduct = $objProduct->getProductsClass($product_class_id);
        $productTypeId = $arrProduct['product_type_id'];
        $find = false;
        $max = $this->getMax($productTypeId);
        for ($i = 0; $i <= $max; $i++) {
            if ($this->cartSession[$productTypeId][$i]['id'] == $product_class_id) {
                $val = $this->cartSession[$productTypeId][$i]['quantity'] + $quantity;
                if (strlen($val) <= INT_LEN) {
                    $this->cartSession[$productTypeId][$i]['quantity'] += $quantity;
                }
                $find = true;
            }
        }
        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]['label_select'] = $label_select;
        }
    }



    /**
     * セッション中の商品情報データの調整。
     * productsClass項目から、不必要な項目を削除する。
     */
    public function adjustSessionProductsClass(&$arrProductsClass)
    {
        $arrNecessaryItems = array(
            'product_id'          => true,
            'product_class_id'    => true,
            'name'                => true,
            'price02'             => true,
            'point_rate'          => true,
            'main_list_image'     => true,
            'main_image'          => true,
            'product_code'        => true,
            'stock'               => true,
            'stock_unlimited'     => true,
            'sale_limit'          => true,
            'class_name1'         => true,
            'classcategory_name1' => true,
            'class_name2'         => true,
            'classcategory_name2' => true,
            'label_select' => true,
        );

        // 必要な項目以外を削除。
        foreach ($arrProductsClass as $key => $value) {
            if (!isset($arrNecessaryItems[$key])) {
                unset($arrProductsClass[$key]);
            }
        }
    }



    public function calculate($productTypeId, &$objCustomer, $use_point = 0,
        $deliv_pref = '', $charge = 0, $discount = 0, $deliv_id = 0,
        $order_pref = 0, $order_country_id = 0,
	$label_select
    ) {

        $results = array();
        $total_point = $this->getAllProductsPoint($productTypeId);
        // MEMO: 税金計算は注文者の住所基準
        $results['tax'] = $this->getAllProductsTax($productTypeId, $order_pref, $order_country_id);
        $results['subtotal'] = $this->getAllProductsTotal($productTypeId, $order_pref, $order_country_id);
        $results['deliv_fee'] = 0;

        // 商品ごとの送料を加算
        if (OPTION_PRODUCT_DELIV_FEE == 1) {
            $cartItems = $this->getCartList($productTypeId);
            foreach ($cartItems as $arrItem) {
                $results['deliv_fee'] += $arrItem['productsClass']['deliv_fee'] * $arrItem['quantity'];
            }
        }

        // 配送業者の送料を加算
        if (OPTION_DELIV_FEE == 1
            && !SC_Utils_Ex::isBlank($deliv_pref)
            && !SC_Utils_Ex::isBlank($deliv_id)) {
            $results['deliv_fee'] += SC_Helper_Delivery_Ex::getDelivFee($deliv_pref, $deliv_id);
        }

        // 送料無料チェック
        if ($this->isDelivFree($productTypeId)) {
            $results['deliv_fee'] = 0;
        }

        // 合計を計算
        $results['total'] = $results['subtotal'];
        $results['total'] += $results['deliv_fee'];
        $results['total'] += $charge;
        $results['total'] -= $discount;


        // お支払い合計
        $results['payment_total'] = $results['total'] - $use_point * POINT_VALUE;

        // 加算ポイントの計算
        if (USE_POINT !== false) {
            $results['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($total_point, $use_point);
            if ($objCustomer != '') {
                // 誕生日月であった場合
                if ($objCustomer->isBirthMonth()) {
                    $results['birth_point'] = BIRTH_MONTH_POINT;
                    $results['add_point'] += $results['birth_point'];
                }
            }
            if ($results['add_point'] < 0) {
                $results['add_point'] = 0;
            }
        }
        $results['label_select'] = $label_select';
        return $results;
    }


----------------

yuh
投稿日時: 2015/2/5 18:11
対応状況: −−−
登録日: 2013/1/9
居住地: 大阪
投稿: 1819
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
$results['label_select'] = $label_select';

ここを
$results['label_select'] = $label_select;
このように変更してください
mizuvan
投稿日時: 2015/2/5 19:40
対応状況: −−−
長老
登録日: 2013/3/26
居住地:
投稿: 253
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
yuh様、ありがとうございます!

うっかりミスがありすみません。

修正後に再度試しましたらまた違うエラーが表示されてしまい・・

2015/02/05 19:29:06 [***/products/list.php] Warning(E_WARNING): Missing argument 2 for LC_Page_Products_List::doDefault(), called in ***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php on line 124 and defined on [***/data/class/pages/products/LC_Page_Products_List.php(512)] from IPアドレス
customer_id = 1
***/products/list.php(29): LC_Page_Products_List_Ex->process
***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php(56): LC_Page_Products_List->process
***/data/class/pages/products/LC_Page_Products_List.php(83): LC_Page_Products_List->action
***/data/class/pages/products/LC_Page_Products_List.php(153): LC_Page_Products_List_Ex->doDefault
***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php(124): LC_Page_Products_List->doDefault
***/data/class/pages/products/LC_Page_Products_List.php(512): SC_Helper_HandleError::handle_warning

LC_Page_Products_List.php(512)というのが、下記の部分でした。

public function doDefault(&$objProduct, &$objFormParam)


なぜlist側にエラーが出てしまうのか不思議なところなのですが

ここにもパラメーターを設定しておかなければならないものなのでしょうか?


----------------

yuh
投稿日時: 2015/2/5 20:43
対応状況: −−−
登録日: 2013/1/9
居住地: 大阪
投稿: 1819
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
/LC_Page_Products_List_Ex.php のline 124を確認してください。
mizuvan
投稿日時: 2015/2/6 11:50
対応状況: −−−
長老
登録日: 2013/3/26
居住地:
投稿: 253
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
yuh様、ありがとうございます!

line124は下記の赤の部分でした。
カテゴリーの取得をするだけで関係するのでしょうか?

    public function doDefault($objProduct) {
        parent::doDefault($objProduct);
        
        // ルートカテゴリを取得。
        $db = new SC_Helper_DB_Ex();
        $this->rootCategory = $db->sfGetCatCombName($this->arrForm['category_id']);
    }


----------------

yuh
投稿日時: 2015/2/6 12:49
対応状況: −−−
登録日: 2013/1/9
居住地: 大阪
投稿: 1819
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
   public function doDefault(&$objProduct, &$objFormParam) {
        parent::doDefault($objProduct, $objFormParam);
        
        // ルートカテゴリを取得。
        $db = new SC_Helper_DB_Ex();
        $this->rootCategory = $db->sfGetCatCombName($this->arrForm['category_id']);
    }



parent::doDefault($objProduct, $objFormParam);
parentの使い方が間違えてましたw
mizuvan
投稿日時: 2015/2/6 18:39
対応状況: −−−
長老
登録日: 2013/3/26
居住地:
投稿: 253
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
yuh様、ありがとうございます!

修正したのですが、下記のようなエラーとなりました。

エラー内容に変化がないようにも見えます

引用:

2015/02/06 18:31:26 [***/products/list.php] Fatal error(E_PARSE): syntax error, unexpected 'function' (T_FUNCTION) on [***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php(124)] from IPアドレス
customer_id = 1
2015/02/06 18:31:51 [***/products/list.php] Warning(E_WARNING): Missing argument 2 for LC_Page_Products_List::doDefault(), called in ***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php on line 124 and defined on [***/data/class/pages/products/LC_Page_Products_List.php(512)] from IPアドレス
customer_id = 1
***/products/list.php(29): LC_Page_Products_List_Ex->process
***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php(56): LC_Page_Products_List->process
***/data/class/pages/products/LC_Page_Products_List.php(83): LC_Page_Products_List->action
***/data/class/pages/products/LC_Page_Products_List.php(153): LC_Page_Products_List_Ex->doDefault
***/data/class_extends/page_extends/products/LC_Page_Products_List_Ex.php(124): LC_Page_Products_List->doDefault
***/data/class/pages/products/LC_Page_Products_List.php(512): SC_Helper_HandleError::handle_warning


----------------

yuh
投稿日時: 2015/2/7 4:51
対応状況: −−−
登録日: 2013/1/9
居住地: 大阪
投稿: 1819
Re: 規格でない、商品について3つの選択肢から1つ選んでもらいたい
   public function doDefault(&$objProduct, &$objFormParam) {
        parent::doDefault($objProduct, $objFormParam);
        
        // ルートカテゴリを取得。
        $db = new SC_Helper_DB_Ex();
        $this->rootCategory = $db->sfGetCatCombName($this->arrForm['category_id']);
    }



parent::doDefault($objProduct, $objFormParam);
parentの部分コピペミスでした
これで試してみてください
(1) 2 »
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は88,688名です
総投稿数は109,934件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2313
5
umebius
2085
6
yuh
1819
7
h_tanaka
1638
8
red
1569
9
mcontact
1280
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.