您现在的位置是:首页 > 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退货时不退其它费

本文标签:

很赞哦! ()

相关源码

  • (PC+WAP)激光水幕音乐喷泉设备工程网站源码下载本模板基于PbootCMS系统开发,为喷泉设备工程类企业设计,特别适合展示音乐喷泉、激光水幕等水景艺术项目。采用响应式技术,确保各类工程案例在不同设备上都能呈现视觉效果。查看源码
  • (PC+WAP)智能机器人人工智能物联网自动化设备源码下载本模板基于PbootCMS内核开发,为智能机器人及传感器科技企业精心设计。采用现代化设计风格,突出科技感与专业性,多方位展示企业技术实力与产品优势。查看源码
  • (自适应响应式)HTML5电脑手机电子数码产品配件pbootcms模板下载本模板为电脑配件、手机配件及数码周边产品企业设计,基于PbootCMS内核开发。采用现代化响应式布局,适配各类移动设备,能够专业展示各类电子产品配件参数、应用场景和技术特点。模板内置多种产品展示模块,满足不同类型配件企业的展示需求。查看源码
  • WordPress主题模板JustNews资讯博客类源码V5.2.2JustNews主题针对博客创作、自媒体运营及资讯发布类网站的需求而设计,提供专业的内容展示与管理方案。该主题集成前端用户中心功能,支持用户在前端界面发布和投稿文章,操作流程简洁高效。查看源码
  • 帝国cms7.5自适应作文新闻资讯教育网站模板本模板基于帝国CMS7.5内核开发,为教育机构、培训学校等知识传播单位打造。通过自适应设计确保在手机、平板、电脑等设备上均能获得专业浏览体验查看源码
  • (自适应)证书授权书防伪查询系统pbootcms模板本模板基于PbootCMS系统开发,为各类证书查询机构设计,可快速构建高效安全的证书核验平台。采用响应式布局技术,自动适配手机端操作,支持批量导入证书数据,提供便捷的查询接口,满足机构证书管理及用户在线核验需求。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐