[Tep-j-general] Re: checkout_success.php内で注文IDと小計を取得したい

Back to archive index

Seiji Sogabe sogab****@alles*****
2006年 6月 14日 (水) 19:20:39 JST


曽我部です。

hidepon0915 wrote:
> 購入手続きの完了画面〜checkout_success.php内で、アフィリエイト会社のタグに注
> 文IDと小計金額(税、送料等を含まない購入合計額)を引き渡す必要が出てきたの
> ですが、どのようにデータを取得すればよいのか良く分かりません。ご教授いただけ
> れば幸いです。

checkout_success.php に、

// 注文IDを取得
$orders_query = tep_db_query(
        "select orders_id from " . TABLE_ORDERS . " where customers_id = '" .
        $customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$orders_id = (int) $orders['orders_id'];

// 小計を取得
$orders_total_query = tep_db_query(
         "select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $orders_id .
         "' and class='ot_subtotal'");
$orders_total = tep_db_fetch_array($orders_total_query);
$subtotal = (int) $orders_total['value'];

を追加すればできると思います。

では。
-- 
sogab****@alles*****




Tep-j-general メーリングリストの案内
Back to archive index