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

ecshop订单付款之后向用户客户发送订单信息确认邮件

千兰2023-12-26Ecshop商城教程已有人查阅

导读要实现这个功能,就要修改ECshop的程序文件:\includes\lib_payment.php,打开该文件,找到166行左右,在”如果需要,发短信”的代码下面,插入以下的代码:

要实现这个功能,就要修改ECshop的程序文件:\includes\lib_payment.php,打开该文件,找到166行左右,在”如果需要,发短信”的代码下面,插入以下的代码:
if ($pay_status){
// 设置邮件的发件人姓名和Email地址:
$service_mail['email'] = $GLOBALS['_CFG']['service_email']; // 自动读取客服邮件地址;
$service_mail['sender'] = $GLOBALS['_CFG']['shop_name']; // 自动读取网店名称;
// 订单的基本情况:
$sql = “SELECT pay_status,shipping_name,shipping_fee,
pay_name,consignee,address,zipcode,tel,money_paid
FROM “.$GLOBALS['ecs']->table(’order_info’).”
WHERE order_id = $order_id “;
$order_info = $GLOBALS['db']->getRow($sql);
if ($order_info['pay_status'] == PS_PAYED) $service_mail['status']=’已付款’;
if ($order_info['pay_status'] == PS_PAYING) $service_mail['status']=’已付款到支付宝’;// 货款暂存于支付宝的状态;
date_default_timezone_set(’PRC’);
$service_mail['subject'] = “订单 $order_sn {$service_mail['status']}。”; // 定义邮件的主题;
// 以下是定义邮件的主要内容,可以根据自己的实际情况调整:
$service_mail['content'] = date(’Y-m-d H:i’).” 订单 $order_sn {$service_mail['status']},可以开始发货。 \r\n”;
if ($note){
$service_mail['content'] .= ‘付款留言:’.$note.”\r\n”;
}
$service_mail['content'] .= “订单的详细情况:\r\n”;
$service_mail['content'] .= “总金额:{$order_info['money_paid']} 元;\r\n”;
$service_mail['content'] .= “配送方式:{$order_info['shipping_name']}(配送费:{$order_info['shipping_fee']})\r\n”;
$service_mail['content'] .= “付款方式:{$order_info['pay_name']}({$service_mail['status']})\r\n”;
$service_mail['content'] .= “收货人:{$order_info['consignee']}\r\n”;
if ($order_info['zipcode']) $order_info['zipcode'] = ” 邮编:{$order_info['zipcode']}”; else $order_info['zipcode'] = ”;
$service_mail['content'] .= “收货人地址:{$order_info['address']} {$order_info['zipcode']}\r\n”;
$service_mail['content'] .= “收货人电话:{$order_info['tel']}\r\n\r\n”;
// 生成商品清单:
$service_mail['content'] .= “订购商品清单:\r\n”;
$sql = “SELECT goods_sn,goods_name,goods_number,goods_price
FROM “.$GLOBALS['ecs']->table(’order_goods’).” og, “.$GLOBALS['ecs']->table(’order_info’).” oi
WHERE og.order_id = oi.order_id
AND oi.order_id = $order_id”;
$res = $GLOBALS['db']->getAll($sql);
foreach ($res as $value){
$service_mail['content'] .= “货号:{$value['goods_sn']}; \t商品:{$value['goods_name']}; \t数量:{$value['goods_number']}; \r\n”;
}
// 发送邮件:
send_mail($service_mail['sender'], $service_mail['email'], $service_mail['subject'], $service_mail['content'], 0);
}

本文标签:

很赞哦! ()

相关源码

  • (PC+WAP)红色驾校培训学车在线预约源码下载基于PbootCMS内核开发的驾校培训专用网站模板,深度适配驾驶培训行业展示需求。采用PC与移动端同步响应设计,单一后台统一管理内容数据,更换图文素材后可快速转变为其他行业网站。查看源码
  • (响应式自适应)小学初中作文论文文章资讯博客pbootcms模板下载为中小学作文、教育类网站设计,特别适合展示学生作文、教学资源和写作指导等内容。采用响应式技术,确保在不同设备上都能获得良好的阅读体验。查看源码
  • (自适应响应式)pbootcms紫色美容整形机构企业模板下载基于PbootCMS内核开发的响应式网站模板,为医疗美容机构、整形医院等企业设计,提供完整的线上展示平台采用紫色系配色方案,整体风格专业大气。模板包含首页轮播、服务项目、专家团队、案例展示等核心模块,能够充分展示医疗美容机构的专业服务和特色优势。查看源码
  • (自适应)帝国cms7.5模板自媒体文章新闻博客为帝国CMS7.5设计的响应式模板,采用H5技术构建现代化内容展示框架。通过智能断点检测技术实现手机、平板、PC三端适配查看源码
  • pbootcms网站网络公司个人作品展示类网站源码(自适应)为网站建设公司、网络服务企业打造的响应式门户解决方案,基于PbootCMS内核深度开发。采用前沿自适应架构,无缝适配手机端交互与PC端展示需求。查看源码
  • HTML5响应式健身俱乐部pbootcms网站模板下载为健身俱乐部、瑜伽中心及运动场馆设计的响应式网站模板,采用PbootCMS内核开发,支持一键替换图文适配健身器材销售、瑜伽工作室等多类型运动健康产业。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐