您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程

ecshop订单管理退货时不退运费的实现方法

从蓉2023-12-08Ecshop商城教程已有人查阅

导读解决ecshop订单管理退货时,如何做到不退邮费,打开admin/order.php在大约4468行处找到

解决ecshop订单管理退货时,如何做到不退邮费,打开admin/order.php在大约4468行处找到
/**  * 退回余额、积分、红包(取消、无效、退货时),把订单使用余额、积分、红包设为0  * @paramarray$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 * @paramarray$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退货时不退其它费

本文标签:

很赞哦! ()

相关源码

  • 帝国cms7.5女性护肤搭配美妆潮流网站源码带数据4.5G本模板专为女性美容护肤行业设计,提供美容护肤、发型设计、女性健康、时尚化妆、娱乐新闻、服饰搭配等女性潮流资讯内容展示。采用帝国CMS7.5开发,同步生成电脑端和手机端,满足用户对美容时尚信息的获取需求。查看源码
  • (自适应响应式)运动健身瑜伽俱乐部网站pbootcms源码下载为健身瑜伽俱乐部设计的响应式网站模板,采用PbootCMS内核开发,可快速搭建专业级企业官网。模板默认适配运动健身行业视觉风格,用户可通过替换图文内容灵活应用于其他服务行业。查看源码
  • (自适应)调节阀门气动球阀控制阀网站模板源码下载为调节阀门、气动球阀等工业设备企业打造的响应式网站模板,基于PbootCMS系统开发。突出产品参数展示与技术文档管理功能,通过专业化的布局设计有效呈现工业设备特性,适配各类终端访问需求。查看源码
  • (自适应html5)自媒体运营培训教程个人博客pbootcms模板本模板基于PbootCMS系统开发,特别适合自媒体运营培训、知识付费类网站使用。采用响应式设计,能够适配各类终端设备,为内容创作者提供专业的内容展示平台。查看源码
  • pbootcms模板(自适应手机版)红色响应式单位机构类网站自适应响应式单位机构网站模板 | PbootCMS内核开发为机构组织设计的响应式网站模板,采用PbootCMS内核开发,支持一键替换行业内容,满足多元化场景需求。查看源码
  • (自适应响应式)化妆美容口红唇膏化妆品模板pbootcms源码下载基于PbootCMS开发的响应式模板,为化妆品品牌、美容机构打造,通过优雅的视觉呈现提升产品展示效果与品牌调性。采用时尚杂志排版风格,色卡系统规范产品展示。微交互动画增强用户体验,智能推荐算法提升产品关联展示效果。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐