解決ecshop訂單管理退貨時(shí),如何做到不退郵費(fèi),提供相關(guān)ecshop教程如下:
打開(kāi)admin/order.php在大約4468行處找到
/**
* 退回余額、積分、紅包(取消、無(wú)效、退貨時(shí)),把訂單使用余額、積分、紅包設(shè)為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);
}
改成
/**
* 退回余額、積分、紅包(取消、無(wú)效、退貨時(shí)),把訂單使用余額、積分、紅包設(shè)為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);
}
就可以了
官方默認(rèn)的是退貨時(shí)把已付款退到會(huì)員的帳中戶,而退回的費(fèi)用中沒(méi)有減去
運(yùn)費(fèi)
支付手費(fèi)費(fèi)
包裝費(fèi)
如果ecshop退貨時(shí)不退運(yùn)費(fèi)應(yīng)是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']: $order['surplus'];
如果退貨時(shí)不退動(dòng)費(fèi)和支付的手費(fèi)費(fèi)應(yīng)是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']- $order['pay_fee']: $order['surplus'];
如果ecshop退貨時(shí)不退動(dòng)費(fèi)和支付的手費(fèi)費(fèi)及包裝費(fèi)應(yīng)是:
$surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid'] - $order['shipping_fee']- $order['pay_fee']]- $order['pack_fee']: $order['surplus'];
以此類(lèi)推可以做到ecshop退貨時(shí)不退其它費(fèi)
新聞熱點(diǎn)
疑難解答
圖片精選