バージョン選択

フォーラム

メニュー

オンライン状況

34 人のユーザが現在オンラインです。 (20 人のユーザが フォーラム を参照しています。)
登録ユーザ: 4
ゲスト: 30
RIKVIP piyush23 tattsu lyly もっと...

サイト内検索

バグ報告 > 管理機能 > コンバージョン

管理機能

新規スレッドを追加する

スレッド表示 | 新しいものから 前のトピック | 次のトピック | 下へ
投稿者 スレッド
HAHAHA
投稿日時: 2014/2/1 16:47
対応状況: −−−
半人前
登録日: 2014/1/31
居住地:
投稿: 22
コンバージョン
初めまして

EC-CUBEにて作成したネットショップでコンバージョンタグを設置したいのです

設置に関しては、下記のサイトを参考にさせていただきました。

[EC-CUBE 2.12.3] 注文完了ページにコンバージョンタグを埋め込みたい
http://ec-cube.nakweb.com/blog/2041.html



しかしながら最新のEC-CUBE 2.13.1 を使用していますので、2.12.3用では
旨く行かずシステムエラーになってしまいます。

2.13.1ようにするにはどうするといいでしょうか?

また、税抜き金額と商品ID 購入者の会員IDも出したいのですが どなたかご教授頂けませんか?


使用環境
EC-CUBE 2.13.1
サーバーOS Linux s57 2.6.32.61-smp #1 SMP Wed Jul 10 20:34:58 JST 2013 i686
DBサーバー MySQL 5.1.22-rc
WEBサーバー Apache
PHP 5.2.5 (libxml, xsl, xmlwriter, xmlrpc, dom, xmlreader, xml, tokenizer, session, pcre, SimpleXML, SPL, PDO, sockets, soap, SQLite, standard, Reflection, posix, pgsql, pdo_sqlite, pdo_pgsql, pdo_mysql, mysqli, mysql, mcrypt, mbstring, json, iconv, hash, gettext, gd, ftp, filter, exif, date, curl, ctype, bcmath, zlib, openssl, cgi)
casa
投稿日時: 2014/2/3 10:23
対応状況: −−−
長老
登録日: 2011/10/3
居住地:
投稿: 210
Re: コンバージョン
こんにちわ。

エラーログには何が出力されているでしょうか。
見た感じ、2.13でもそのまま使えるコードのような気がします。

最後の以下の行は、2.13では消しておいた方がよいです。
unset($_SESSION['order_id']);

process() の方に処理が移動してありますので。
HAHAHA
投稿日時: 2014/2/4 19:14
対応状況: −−−
半人前
登録日: 2014/1/31
居住地:
投稿: 22
Re: コンバージョン
ありがとうございます。

やっぱり エラーが出ました。;;

下記のように記述してみました。(下から12行位を加えました)

    public function process()
    {
        parent::process();
        $this->action();
        $this->sendResponse();
        // プラグインなどで order_id を取得する場合があるため,  ここで unset する
        unset($_SESSION['order_id']);
    }

    /**
     * Page のアクション.
     *
     * @return void
     */
    public function action()
    {
        $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();

   // 注文IDを取得
    $this->order_id = $_SESSION['order_id'];

    // 小計価格(税抜)の取得
    $objQuery = SC_Query::getSingletonInstance();
    $col = 'subtotal, tax';
    $table = 'dtb_order';
    $where = 'order_id = ?';
    $arrval = array($this->order_id);
    $arrRet = $objQuery->select($col, $table, $where, $arrval);
    $this->subtotal_exctax = $arrRet[0]['subtotal'] - $arrRet[0]['tax'];
    }
    public function process()
    {
        parent::process();
        $this->action();
        $this->sendResponse();
        // プラグインなどで order_id を取得する場合があるため,  ここで unset する
        unset($_SESSION['order_id']);
    }

    /**
     * Page のアクション.
     *
     * @return void
     */
    public function action()
    {
        $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();

   // 注文IDを取得
    $this->order_id = $_SESSION['order_id'];

    // 小計価格(税抜)の取得
    $objQuery = SC_Query::getSingletonInstance();
    $col = 'subtotal, tax';
    $table = 'dtb_order';
    $where = 'order_id = ?';
    $arrval = array($this->order_id);
    $arrRet = $objQuery->select($col, $table, $where, $arrval);
    $this->subtotal_exctax = $arrRet[0]['subtotal'] - $arrRet[0]['tax'];
    }






エラーはこのように出ました。記述違い? ですかね



Fatal error(E_PARSE): syntax error, unexpected T_VARIABLE on [/eccube/data/class/pages/shopping/LC_Page_Shopping_Complete.php(70)] from 1.115.196.167
customer_id = 1



よろしくお願いします。
sumida
投稿日時: 2014/2/4 19:50
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: コンバージョン
action()が2つあるのは、別として、
「// 注文IDを取得」の前の空白が、全角ではないでしょうか。
HAHAHA
投稿日時: 2014/2/4 22:54
対応状況: −−−
半人前
登録日: 2014/1/31
居住地:
投稿: 22
Re: コンバージョン
有難うございます。
単純な事ですみません。
おっしゃる通り 全角でした。そのため エラーになっていた様です。

所がテンプレートにて
<!--{$order_id}--> <!--{$subtotal_exctax}--> が 反応せず。

<!--{$order_id}--> は表示無し
<!--{$subtotal_exctax}--> は 00

でした。

表示させるタグが違うのでしょうか?


ーーー
先のPHP表示が間違っていましたので、再度記述します。


<?php
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php';

/**
 * ご注文完了 のページクラス.
 *
 * @package Page
 * @author LOCKON CO.,LTD.
 * @version $Id:LC_Page_Shopping_Complete.php 15532 2007-08-31 14:39:46Z nanasess $
 */
class LC_Page_Shopping_Complete extends LC_Page_Ex
{
    /**
     * Page を初期化する.
     *
     * @return void
     */
    public function init()
    {
        parent::init();
        $this->tpl_title = 'ご注文完了';
    }

    /**
     * Page のプロセス.
     *
     * @return void
     */
    public function process()
    {
        parent::process();
        $this->action();
        $this->sendResponse();
        // プラグインなどで order_id を取得する場合があるため,  ここで unset する
        unset($_SESSION['order_id']);
    }

    /**
     * Page のアクション.
     *
     * @return void
     */
    public function action()
    {
        $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData();

    // 注文IDを取得
    $this->order_id = $_SESSION['order_id'];

    // 小計価格(税抜)の取得
    $objQuery = SC_Query::getSingletonInstance();
    $col = 'subtotal, tax';
    $table = 'dtb_order';
    $where = 'order_id = ?';
    $arrval = array($this->order_id);
    $arrRet = $objQuery->select($col, $table, $where, $arrval);
    $this->subtotal_exctax = $arrRet[0]['subtotal'] - $arrRet[0]['tax'];
    }

    /**
     * 決済モジュールから遷移する場合があるため, トークンチェックしない.
     */
    public function doValidToken()
    {
        // nothing.
    }
}
casa
投稿日時: 2014/2/5 9:40
対応状況: −−−
長老
登録日: 2011/10/3
居住地:
投稿: 210
Re: コンバージョン
もう一度商品を購入しなおしてみてください。

いきなり注文完了画面を表示したり、一度買い物が完了したあとに
注文完了画面を再読み込みしたりしても、データは取得されません。
HAHAHA
投稿日時: 2014/2/5 11:24
対応状況: −−−
半人前
登録日: 2014/1/31
居住地:
投稿: 22
Re: コンバージョン
ありがとうございます。

普通に買い物かごへいれて、通常に完了させています。

完了ページでは 再読み込み等せずに ソースをみても

前後の文字は表示してますが変数の所は なしか 00 でした。

sumida
投稿日時: 2014/2/5 15:14
対応状況: −−−
仙人
登録日: 2013/2/10
居住地: 広島県呉市ときどき瀬戸内海
投稿: 641
Re: コンバージョン
LC_Page_Shopping_Confirm.phpを見ていたのですが、

            case 'confirm':
                /*
                 * 決済モジュールで必要なため, 受注番号を取得
                 */
                $this->arrForm['order_id'] = $objPurchase->getNextOrderID();
                $_SESSION['order_id'] = $this->arrForm['order_id'];

$_SESSION['order_id']には、$objPurchase->getNextOrderID()の値が入っています。
この関数名「getNextOrderID」からすると、$_SESSION['order_id']には、次期受注番号が入っているような。
casa
投稿日時: 2014/2/5 15:46
対応状況: −−−
長老
登録日: 2011/10/3
居住地:
投稿: 210
Re: コンバージョン
sumida様

今回の注文用に新たな注文番号を取得している処理ですので、問題ありません。
ここで取得した注文番号で受注が登録され、完了画面のSESSIONにもこの番号が引き継がれます。


HAHAHA様

「2014-2-4 22:54」にHAHAHA様が投稿されたソースをそのまま全て貼り付けて実行しましたが、問題なく動作致しました。
テンプレート側にはどのように記載されていますか?
当方では、上記投稿内の
「<!--{$order_id}--> <!--{$subtotal_exctax}--> が 反応せず。」
という記載をそのままコピペしましたが、正常動作を確認致しました。

テンプレートにも問題がない場合ですが、
何か決済サービスを導入されていますでしょうか?
もしかすると、決済完了時に決済サービス側で$_SESSION['order_id']を
消しているのかもしれません。
HAHAHA
投稿日時: 2014/2/6 11:16
対応状況: −−−
半人前
登録日: 2014/1/31
居住地:
投稿: 22
Re: コンバージョン
ありがとうございます。

決済にはPAYPALを入れていますので、そのせいで
おっしゃる通り消しているのかもしれませんね;;

さぁ こまったです。

消さないようにするのか、そうすると何か不都合が出るかもですよね;;
(1) 2 3 4 »
スレッド表示 | 新しいものから 前のトピック | 次のトピック | トップ


 



ログイン


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

統計情報

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

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2311
5
umebius
2085
6
yuh
1819
7
h_tanaka
1632
8
red
1569
9
mcontact
1259
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.