解決ecshop訂單管理退貨時,如何做到不退郵費,提供相關ecshop教程如下:
打開admin/order.php在大約4468行處找到
/**
* 退回余額、積分、紅包(取消、無效、退貨時),把訂單使用余額、積分、紅包設為0
* @param array $order 訂單信息
*/
function return_user_surplus_integral_bonus($order)
{
/* 處理余額、積分、紅包 */
if ($order['user_id'] > 0 && $order['surplus'] > 0)
{
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid']: $order['surplus'];
log_account_change($order['user_id'], $surplus, 0, 0, 0, sprintf($GLOBALS['_LANG']['return_order_surplus'], $order['order_sn']));
$GLOBALS['db']->query("UPDATE ". $GLOBALS['ecs']->table('order_info') . " SET `order_amount` = '0' WHERE `order_id` =". $order['order_id']);
}
if ($order['user_id'] > 0 && $order['integral'] > 0)
{
log_account_change($order['user_id'], 0, 0, 0, $order['integral'], sprintf($GLOBALS['_LANG']['return_order_integral'], $order['order_sn']));
}
if ($order['bonus_id'] > 0)
{
unuse_bonus($order['bonus_id']);
}
/* 修改訂單 */
$arr = array(
'bonus_id' => 0,
'bonus' => 0,
'integral' => 0,
'integral_money' => 0,
'surplus' => 0
);
update_order($order['order_id'], $arr);
}
改成
/**
* 退回余額、積分、紅包(取消、無效、退貨時),把訂單使用余額、積分、紅包設為0
* @param array $order 訂單信息
*/
function return_user_surplus_integral_bonus($order)
{
/* 處理余額、積分、紅包 */
if ($order['user_id'] > 0 && $order['surplus'] > 0)
{
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid']-$order['shipping_fee'] : $order['surplus'];
log_account_change($order['user_id'], $surplus, 0, 0, 0, sprintf($GLOBALS['_LANG']['return_order_surplus'], $order['order_sn']));
$GLOBALS['db']->query("UPDATE ". $GLOBALS['ecs']->table('order_info') . " SET `order_amount` = '0' WHERE `order_id` =". $order['order_id']);
}
if ($order['user_id'] > 0 && $order['integral'] > 0)
{
log_account_change($order['user_id'], 0, 0, 0, $order['integral'], sprintf($GLOBALS['_LANG']['return_order_integral'], $order['order_sn']));
}
if ($order['bonus_id'] > 0)
{
unuse_bonus($order['bonus_id']);
}
/* 修改訂單 */
$arr = array(
'bonus_id' => 0,
'bonus' => 0,
'integral' => 0,
'integral_money' => 0,
'surplus' => 0
);
update_order($order['order_id'], $arr);
}
就可以了
官方默認的是退貨時把已付款退到會員的帳中戶,而退回的費用中沒有減去
運費
支付手費費
包裝費
如果ecshop退貨時不退運費應是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']: $order['surplus'];
如果退貨時不退動費和支付的手費費應是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']- $order['pay_fee']: $order['surplus'];
如果ecshop退貨時不退動費和支付的手費費及包裝費應是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']- $order['pay_fee']]- $order['pack_fee']: $order['surplus'];
以此類推可以做到ecshop退貨時不退其它費
新聞熱點
疑難解答