解决ecshop订单管理退货时,如何做到不退邮费

解决ecshop订单管理退货时,如何做到不退邮费

2015-5-24 11:42 | 发布者: moke | 栏目:ecshop教程

解决ecshop订单管理退货时,如何做到不退邮费,提供相关ecshop教程如下:

打开admin/order.php在大约4468行处找到

 

  1. /** 
  2. * 退回余额、积分、红包(取消、无效、退货时),把订单使用余额、积分、红包设为0 
  3. * @param   array   $order  订单信息 
  4. */ 
  5. function return_user_surplus_integral_bonus($order
  6.     /* 处理余额、积分、红包 */ 
  7.     if ($order['user_id'] > 0 && $order['surplus'] > 0) 
  8.     { 
  9.         $surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid']: $order['surplus']; 
  10.         log_account_change($order['user_id'], $surplus, 0, 0, 0, sprintf($GLOBALS['_LANG']['return_order_surplus'], $order['order_sn'])); 
  11.         $GLOBALS['db']->query("UPDATE "$GLOBALS['ecs']->table('order_info') . " SET `order_amount` = '0' WHERE `order_id` ="$order['order_id']); 
  12.     } 
  13.  
  14.     if ($order['user_id'] > 0 && $order['integral'] > 0) 
  15.     { 
  16.         log_account_change($order['user_id'], 0, 0, 0, $order['integral'], sprintf($GLOBALS['_LANG']['return_order_integral'], $order['order_sn'])); 
  17.     } 
  18.  
  19.     if ($order['bonus_id'] > 0) 
  20.     { 
  21.         unuse_bonus($order['bonus_id']); 
  22.     } 
  23.  
  24.     /* 修改订单 */ 
  25.     $arr = array
  26.         'bonus_id'  => 0, 
  27.         'bonus'     => 0, 
  28.         'integral'  => 0, 
  29.         'integral_money'    => 0, 
  30.         'surplus'   => 0 
  31.     ); 
  32.     update_order($order['order_id'], $arr); 

改成

 

  1. /** 
  2. * 退回余额、积分、红包(取消、无效、退货时),把订单使用余额、积分、红包设为0 
  3. * @param   array   $order  订单信息 
  4. */ 
  5. function return_user_surplus_integral_bonus($order
  6.     /* 处理余额、积分、红包 */ 
  7.     if ($order['user_id'] > 0 && $order['surplus'] > 0) 
  8.     { 
  9.         $surplus = $order['money_paid'] < 0 ? $order['surplus'] + $order['money_paid']-$order['shipping_fee'] : $order['surplus']; 
  10.         log_account_change($order['user_id'], $surplus, 0, 0, 0, sprintf($GLOBALS['_LANG']['return_order_surplus'], $order['order_sn'])); 
  11.         $GLOBALS['db']->query("UPDATE "$GLOBALS['ecs']->table('order_info') . " SET `order_amount` = '0' WHERE `order_id` ="$order['order_id']); 
  12.     } 
  13.  
  14.     if ($order['user_id'] > 0 && $order['integral'] > 0) 
  15.     { 
  16.         log_account_change($order['user_id'], 0, 0, 0, $order['integral'], sprintf($GLOBALS['_LANG']['return_order_integral'], $order['order_sn'])); 
  17.     } 
  18.  
  19.     if ($order['bonus_id'] > 0) 
  20.     { 
  21.         unuse_bonus($order['bonus_id']); 
  22.     } 
  23.  
  24.     /* 修改订单 */ 
  25.     $arr = array
  26.         'bonus_id'  => 0, 
  27.         'bonus'     => 0, 
  28.         'integral'  => 0, 
  29.         'integral_money'    => 0, 
  30.         'surplus'   => 0 
  31.     ); 
  32.     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退货时不退其它费

查看更多 ecshop教程 ecshop模板

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值