2_ECSHOP后台为订单增加备注功能
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
ECSHOP后台为订单增加备注功能
CREATE TABLE IF NOT EXISTS `ecs_order_note` (
`note_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`order_id` mediumint(8) unsigned NOT NULL,
`note_value` text NOT NULL,
PRIMARY KEY (`note_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
/* 订单备注*/
$_LANG['label_order_note'] = '客服人员订单备注:';
/*------------------------------------------------------ */
//-- 保存订单备注
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'save_ordernote')
{
$oid = $_REQUEST['oid'];
$oval = $_REQUEST['noteVal'];
$sql = "select count(note_value) from " . $ecs->table('order_note') .
" where order_id = $oid";
$note_count = $db->getOne($sql);
if ($note_count == 0)
{
$sql = "insert into " . $ecs->table('order_note') .
"(order_id,note_value) values(" . $oid . ",'" . $oval . "')";
} else
{
$sql = "update " . $ecs->table('order_note') . " set note_value = '" . $oval .
"' where order_id = " . $oid;
}
$db->query($sql);
在以下代码下加入
/* 取得能执行的操作列表*/
$operable_list = operable_list($order);
$smarty->assign('operable_list', $operable_list);
在本文件admin\templates\order_info.htm的JS代码中加入下面内容
删除订单时删除关联的订单备注admin/order.php
找到下面代码:
/* 删除订单*/
$db->query("DELETE FROM ".$ecs->table('order_info'). " WHERE order_id = '$order_id'");
$db->query("DELETE FROM ".$ecs->table('order_goods'). " WHERE order_id = '$order_id'");
$db->query("DELETE FROM ".$ecs->table('order_action'). " WHERE order_id = '$order_id'");
在后面直接加入以下代码:(单个删除)
/*根据订单编号,删除对应订单备注*/
$db->query("DELETE FROM " .$ecs->table('order_note') . " WHERE order_id = '$order_id'");
批量删除,找到以下代码:约3000行后面
/* 删除订单*/
$db->query("DELETE FROM ".$ecs->table('order_info'). " WHERE order_id = '$order[order_id]'");
$db->query("DELETE FROM ".$ecs->table('order_goods'). " WHERE order_id = '$order[order_id]'");
$db->query("DELETE FROM ".$ecs->table('order_action'). " WHERE order_id = '$order[order_id]'");
直接加入以下代码:
/*根据订单编号,删除对应订单备注(批量删除)*/
$db->query("DELETE FROM " .$ecs->table('order_note') . " WHERE order_id = '$order[order_id]'");
在以下代码
$GLOBALS['db']->query("DELETE FROM ".$GLOBALS['ecs']->table('order_info'). " WHERE order_id = '$order_id'");
$GLOBALS['db']->query("DELETE FROM ".$GLOBALS['ecs']->table('order_goods'). " WHERE order_id = '$order_id'");
$GLOBALS['db']->query("DELETE FROM ".$GLOBALS['ecs']->table('order_action'). " WHERE order_id = '$order_id'");
后面加入以下代码
/*根据订单编号,删除对应订单备注*/
$GLOBALS['db']->query("DELETE FROM ".$GLOBALS['ecs']->table('order_note'). " WHERE order_id = '$order_id'");
增加邮件模板
ecs_mail_templates
插入一条记录:
\languages\zh_cn\admin\mail_template.php
$_LANG['recomment'] = '用户评论回复模板';
在此后面加入以下内容
$_LANG['agent_bonus'] = '代理商支付费用模板';
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`,
`action_code`, `relevance`) VALUES (NULL, '0', 'agents_manage', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '136', 'agents_list', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '136', 'add_agents', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '0', 'agent_bonus_manage', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '139', 'agent_bonus_seach', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '139', 'agent_bonus_set', '');
INSERT INTO `sumjunet`.`ecs_admin_action` (`action_id`, `parent_id`, `action_code`, `relevance`) VALUES (NULL, '139', 'do_agent_bonus', '');
扩展名:
<th><a href="javascript:listTable.sort('goods_name');
">{$lang.goods_name}</a>{$sort_goods_name}</th>
下面增加:
<th><a href="javascript:listTable.sort('goods_name_extends');
">{$lang.goods_name_extends}</a>{$sort_goods_name_extends}</th>
<td class="first-cell" style="{if $goods.is_promote}color:red;{/if}"><span
onclick="listTable.edit(this, 'edit_goods_name',
{$goods.goods_id})">{$goods.goods_name|escape:html}</span></td> <td class="first-cell" style="{if $goods.is_promote}color:red;{/if}"><span
id="goods_extends" onclick="listTable.edit_teshu(this, 'edit_goods_name_extends', {$goods.goods_id})">{$goods.goods_name_extends|escape:html} </span></td>
/languages/zh_cn/admin/goods.php
68行
$_LANG['goods_name'] = '商品名称';
下面增加
$_LANG['goods_name_extends'] = '商品名称扩展';
Themes/default/goods.dwt
217行
<p class="f_l">{$goods.goods_style_name}{$goods.goods_name_extends}</p>。