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

ecshop退换货插件安装使用教程说明

凌瑶2024-03-16 00:02:29ecshop商城教程已有人查阅

导读各位ECSHOP网店系统用户大家好,欢迎来到ECSHOP教程网图文教程,今天为大家详细解说一下ECSHOP退换货插件安装教程。 ECSHOP教程网ECSH

ECSHOP退换货插件安装教程。
user.php
$smarty->display('user_clips.dwt');
}
下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
if($action == 'refund')
{
$rec_id = $_REQUEST['rec_id'];
$goods = get_order_goods_info($rec_id);
if($goods['refund_status']>0)
{
die("invalid");
}
if(!can_refund($goods['order_id']) )
{
die("invalid");
}
$refund_reason_arr = array("无理由退货", "质量问题", "与描述不符");
$options = array();
foreach($refund_reason_arr as $k=>$v)
{
$options[$v] = $v;
}
$smarty->assign('refund_reason_options', $options );
$smarty->assign('refund_goods', $goods);
$smarty->display("user_transaction.dwt");
}
//mod by ebingou.cn ECSHOP代码号二次开发
if('act_refund' == $action)
{
$rec_id = $_POST['rec_id'];
$refund = $_POST;
unset($refund['rec_id']);
$refund['refund_pic1'] = (isset($_FILES['refund_pic1']['error']) && $_FILES['refund_pic1']['error'] == 0) || (!isset($_FILES['refund_pic1']['error']) && isset($_FILES['refund_pic1']['tmp_name']) && $_FILES['refund_pic1']['tmp_name'] != 'none')
? $_FILES['refund_pic1'] : array();
$refund['refund_pic2'] = (isset($_FILES['refund_pic2']['error']) && $_FILES['refund_pic2']['error'] == 0) || (!isset($_FILES['refund_pic2']['error']) && isset($_FILES['refund_pic2']['tmp_name']) && $_FILES['refund_pic2']['tmp_name'] != 'none')
? $_FILES['refund_pic2'] : array();
$refund['refund_pic3'] = (isset($_FILES['refund_pic3']['error']) && $_FILES['refund_pic3']['error'] == 0) || (!isset($_FILES['refund_pic3']['error']) && isset($_FILES['refund_pic3']['tmp_name']) && $_FILES['refund_pic3']['tmp_name'] != 'none')
? $_FILES['refund_pic3'] : array();
if(refund_apply_order_goods($refund, $rec_id) )
{
show_message("成功申请退款", "订单列表", "user.php?act=order_list");
}
else
{
$GLOBALS['err']->show("订单列表", 'user.php?act=order_list');
}
}
$orders = get_user_orders($user_id, $pager['size'], $pager['start']);
改为
$orders = get_user_orders_ex($user_id, $pager['size'], $pager['start']);//mod by ebingou.cn ECSHOP代码号二次开发
lib_common.php里面
if (!defined('IN_ECS'))
{
die('Hacking attempt');
}
下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
include_once(ROOT_PATH."includes/lib_return.php");
user_transaction.dwt 文件
下面添加
{if $action eq 'refund'}
{/if}
下面对照 覆盖
{$lang.label_order}
{foreach from=$item.goods_list name="foreach_goods_list" item=goods}
{if $smarty.foreach.foreach_goods_list.first}
{/if}
{/foreach}
商品 单价 数量 售后 实付款 状态 {$lang.handle} 订单编号:{$item.order_sn}  成交时间:{$item.order_time}  总金额:{$item.total_fee} {$goods.goods_name} {$goods.shop_price_fmt} {$goods.goods_number}
{if $item.can_refund}
{if $goods.refund_status eq 0}申请退款{/if}
{if $goods.refund_status eq 1}退款处理中{/if}
{if $goods.refund_status eq 2}退款成功{/if}
{if $goods.refund_status eq 3}退款失败{/if}
{/if}
{$goods.goods_price_fmt} {$item.order_status} 查看详情 {$item.handler}
后台admin文件夹修改开始  。。。。。。。。。。。。。。。。。。
admin/order。php文件
(1)
elseif ($_REQUEST['act'] == 'list')
改为
elseif ($_REQUEST['act'] == 'list' || 'refund_list' == $_REQUEST['act'])
(2)
/* 检查权限 */
admin_priv('order_view');下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
$refund_ex = 'refund_list' == $_REQUEST['act'] ? " refund_status>'0'" : "";
(3) $smarty->assign('ur_here', $_LANG['02_order_list']);
修改为
$smarty->assign('ur_here', 'list' == $_REQUEST['act'] ? $_LANG['02_order_list'] : "退款申请列表");
(4) $order_list = order_list();修改为
$order_list = order_list($refund_ex);
(5) $smarty->assign('sort_order_time', '');下面添加
$tpl_file = 'order_list.htm';
'refund_list' == $_REQUEST['act'] && $tpl_file='refund_list.htm';
(6)  /* 显示模板 */
assign_query_info();
$smarty->display('order_list.htm');
}
修改为
/* 显示模板 */
assign_query_info();
$smarty->display($tpl_file);
}
//mod by ebingou.cn ECSHOP代码号二次开发
elseif('confirm_refund' == $_REQUEST['act'])
{
$rec_id = intval($_REQUEST['rec_id']);
$rec_id<=0 && die("invalid");
$agree = intval($_REQUEST['agree']);
$refund_status = $agree ? 2 : 3;
refund_confirm_order_goods($rec_id, $refund_status);
$links[] = array('text' => '退款申请列表', 'href' => 'order.php?act=refund_list');
sys_msg("成功处理该退款申请", 1, $links);
}
(7)
/*------------------------------------------------------ */
//-- 排序、分页、查询
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'query')
{
/* 检查权限 */
admin_priv('order_view');
$order_list = order_list();
$smarty->assign('order_list',   $order_list['orders']);
$smarty->assign('filter',       $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count',   $order_list['page_count']);
$sort_flag  = sort_flag($order_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('order_list.htm'), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
修改为
/*------------------------------------------------------ */
//-- 排序、分页、查询
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'query' || $_REQUEST['act']=='refund_query')
{
/* 检查权限 */
admin_priv('order_view');
//mod by ebingou.cn ECSHOP代码号二次开发
$refund_ex = 'refund_query' == $_REQUEST['act'] ? " refund_status>'0'" : "";
$order_list = order_list($refund_ex);
//mod by ebingou.cn ECSHOP代码号二次开发
$tpl_file = 'order_list.htm';
'refund_query' == $_REQUEST['act'] && $tpl_file='refund_list.htm';
$smarty->assign('order_list',   $order_list['orders']);
$smarty->assign('filter',       $order_list['filter']);
$smarty->assign('record_count', $order_list['record_count']);
$smarty->assign('page_count',   $order_list['page_count']);
$sort_flag  = sort_flag($order_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch($tpl_file), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
(8)
$filter['start_time'] = empty($_REQUEST['start_time']) ? '' : (strpos($_REQUEST['start_time'], '-') > 0 ?  local_strtotime($_REQUEST['start_time']) : $_REQUEST['start_time']);
$filter['end_time'] = empty($_REQUEST['end_time']) ? '' : (strpos($_REQUEST['end_time'], '-') > 0 ?  local_strtotime($_REQUEST['end_time']) : $_REQUEST['end_time']);
$where = 'WHERE 1 ';
下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
if(!empty($refund_ex) )
{
$arr = $GLOBALS['db']->getCol("select distinct order_id from ".$GLOBALS['ecs']->table("order_goods")." where   ".$refund_ex);
$arr[] = 0;
$where .= " and o.order_id ".db_create_in($arr);
}
(9)
$row[$key]['formated_order_amount'] = price_format($value['order_amount']);
$row[$key]['formated_money_paid'] = price_format($value['money_paid']);
$row[$key]['formated_total_fee'] = price_format($value['total_fee']);
$row[$key]['short_order_time'] = local_date('m-d H:i', $value['add_time']);
下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
$row[$key]['refund_goods_list'] = get_order_goods_list($value['order_id'], " and refund_status>0");
(10)
/**
*  获取订单列表信息
*
* @access  public
* @param
*
* @return void
*/
function order_list()
修改为
/**
*  获取订单列表信息
*
* @access  public
* @param
*
* @return void
*/
function order_list($refund_ex="")//mod by ebingou.cn ECSHOP代码号二次开发
admin/index.php修改
/* 退款申请 */
$smarty->assign('new_repay', $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('user_account') . ' WHERE process_type = ' . SURPLUS_RETURN . ' AND is_paid = 0 '));
下面添加
//mod by ebingou.cn ECSHOP代码号二次开发
$smarty->assign('refund_goods', $GLOBALS['db']->getOne("select count(*) from ".$GLOBALS['ecs']->table("order_goods")." where refund_status=1") );
。。。。。。。。。。。。。。。。。。。。。
admin/start.htm
{$lang.new_booking}
{$booking_goods}
{$lang.new_reimburse}
{$new_repay}
下面添加
退换货申请
{$refund_goods}
其他文件 是新加文件 直接覆盖
最后后台sql执行:前缀改成你的
alter table ecs_order_goods
add refund_reason    varchar(255)    not null default '',
add refund_desc    text    not null default '',
add refund_pic1    varchar(255)    not null default '',
add refund_pic2    varchar(255)    not null default '',
add refund_pic3    varchar(255)    not null default '',
add refund_add_time    int(10) unsigned    not null default '0',
add refund_confirm_time    int(10) unsigned    not null default '0',
add refund_confirm_desc    text    not null default '',
add refund_status    tinyint(1) unsigned not null default '0';

本文标签:

很赞哦! ()

相关文章

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签