1注文ごとにポイント付与されるように変更しました。大した手直しではないのですが対応が遅くなり申し訳ないです・・
当方の都合でトータルのポイントを確認したかったので最終保持ポイントを表示するようにしていたのですが、今回はそちらを外しました。よって、お客様側で確認できるポイント数と管理画面で確認できるポイント数は同じになります。
連続注文(例えば同じお客様で2件分)しても1注文を発送済みにした場合、その注文分のポイントのみ付与されます。また、連続注文分を同時に発送済みにした場合でも注文分まとめてポイント付与されます。
キャンセル後に再び新規に移動して発送後、発送済みにした場合でもポイント付与されますが、ポイント付与後のキャンセルがあった場合はポイントを手動で差し引きする必要があります。
顧客管理の最終保持ポイント欄は不要になります。必要のない方はテンプレートの該当場所を消してください。
Smarty/templates/default/admin/customer/edit.tpl
Smarty/templates/default/admin/customer/edit_confirm.tpl
変更箇所↓
LC_Page_Shopping_Complete.php
引用:
/* 購入情報を会員テーブルに登録する */
function lfSetCustomerPurchase($customer_id, $arrData, &$objQuery) {
$col = "first_buy_date, last_buy_date, buy_times, buy_total, point, total_point";
$where = "customer_id = ?";
$arrRet = $objQuery->select($col, "dtb_customer", $where, array($customer_id));
$sqlval = $arrRet[0];
if($sqlval['first_buy_date'] == "") {
$sqlval['first_buy_date'] = "Now()";
}
$sqlval['last_buy_date'] = "Now()";
$sqlval['buy_times']++;
$sqlval['buy_total']+= $arrData['total'];
$sqlval['point'] = ($sqlval['point'] - $arrData['use_point']);
// ポイントが不足している場合
if($sqlval['point'] < 0) {
$objQuery->rollback();
SC_Utils_Ex::sfDispSiteError(LACK_POINT);
}
$objQuery->update("dtb_customer", $sqlval, $where, array($customer_id));
}
LC_Page_Admin_Order_Status.php
引用:
//ステータス情報の更新(削除)
function lfStatusMove($status_id, $arrMove){
$objQuery = new SC_Query();
$masterData = new SC_DB_MasterData_Ex();
$arrORDERSTATUS = $masterData->getMasterData("mtb_order_status");
$table = 'dtb_order';
$where = 'order_id = ?';
$arrUpdate = array('update_date' => 'NOW()');
$col = 'customer_id, add_point';
$delflg = '1'; // 削除フラグ
$message = ''; // ステータス変更後にポップアップするメッセージの内容
if ( $status_id == 'delete' ) {
$arrUpdate['del_flg'] = $delflg;
$message = '削除';
}
// ステータスが発送済みの時は発送日を更新
elseif ( $status_id == ORDER_DELIV ) {
$arrUpdate['status'] = $status_id;
$arrUpdate['commit_date'] = 'NOW()';
$message = $arrORDERSTATUS[$status_id] . 'へ移動';
}
else {
$arrUpdate['status'] = $status_id;
$message = $arrORDERSTATUS[$status_id] . 'へ移動';
}
if ( isset($arrMove) ){
foreach ( $arrMove as $val ){
if ( $val != "" ) {
if ( $status_id == ORDER_DELIV ) {
$arrRet = $objQuery->select($col, $table, $where, array($val));
$customer_id = $arrRet[0]['customer_id'];
$add_point = $arrRet[0]['add_point'];
if($customer_id != "" && $customer_id >= 1) {
$arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id));
$arrRet[0]['point']+= $add_point;
$sqlval['point'] = $arrRet[0]['point'];
$objQuery->update('dtb_customer', $sqlval, 'customer_id = ?', array($customer_id));
}
}
$objQuery->update($table, $arrUpdate, $where, array($val));
}
}
}
$this->tpl_onload = "window.alert('選択項目を" . $message . "しました。');";
}
コミットしようと思いましたが、コミットする該当ファイルは正式版とは内容が異なる為、テストしてから変更します。