magento 如何在跳转到支付界面前自动发送邮件
来源:互联网 发布:mac误删了全部系统 编辑:程序博客网 时间:2024/05/22 18:54
在magento系统中,默认是在支付成功后发送确认订单邮件的,但是有时我们会碰到支付不成功的情况或者客户不想支付,那我们怎样才能在支付前就发送订单邮件呢?首先我们打开appcodecoreMageCheckoutModelType文件夹下的Onepage.php文件,找到saveOrder()方法,可以看到有这么几句:
$order = $service->getOrder();
if ($order) {
Mage::dispatchEvent('checkout_type_onepage_save_order_after', array('order'=>$order, 'quote'=>$this->getQuote()));
/**
* a flag to set that there will be redirect to third party after confirmation
* eg: paypal standard ipn
*/
$redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();
/**
* we only want to send to customer about new order when there is no redirect to third party
*/
if(!$redirectUrl){
try {
$order->sendNewOrderEmail();
} catch (Exception $e) {
Mage::logException($e);
}
}
// add order information to the session
$this->_checkoutSession->setLastOrderId($order->getId())
->setRedirectUrl($redirectUrl)
->setLastRealOrderId($order->getIncrementId());
// as well a billing agreement can be created
$agreement = $order->getPayment()->getBillingAgreement();
if ($agreement) {
$this->_checkoutSession->setLastBillingAgreementId($agreement->getId());
}
}
可以发现magento系统是在保存订单数据后就立即跳转到支付URL上去了,而如果没有支付跳转,则会发送邮件。那我们现在就可以把
if(!$redirectUrl){
try {
$order->sendNewOrderEmail();
} catch (Exception $e) {
Mage::logException($e);
}
}
中的if条件注释掉,这样就可以保证无论是否存在支付跳转,系统都会发送订单确认邮件。
- magento 如何在跳转到支付界面前自动发送邮件
- 如何自动发送邮件
- Android跳转到支付宝转账界面
- PHP 如何自动发送邮件?
- magento发送邮件机制
- magento 客户等级自动提升并且发送邮件
- Laravel5自动跳转到登陆前页面
- 安装完magento后,其他电脑无法访问magento,URL自动跳转到http://localhost/magento
- java自动发送邮件到目标邮箱
- 发送邮件自动保存到草稿箱
- android 自动跳转到系统设置界面
- Android 自动跳转到系统界面总结
- 3s自动跳转到登陆界面
- Intent发送短信(跳转到发送界面)
- 如何做登录后自动跳转到登录前要访问的页面
- 如何做登录后自动跳转到登录前要访问的页面
- 在jsp中怎么实现登录后自动跳转到登陆前浏览页面
- magento email:发送自定义邮件
- 【转】TI达芬奇(DaVinci)技术
- 解决subclipse同步冲突问题A conflict in the working copy obstructs the current operation
- 新兵选电阻的故事
- eclipse最全快捷键
- 企业软件的发展前景
- magento 如何在跳转到支付界面前自动发送邮件
- XML序列化与反序列化
- 史上最全的android开发资料大集合
- Custom checkout cart – How to send email after successful checkout
- openwrt编译过程
- XP LINUX(redhat as 4) 双系统
- JSP+Tomcat环境配置
- 转载很好的介绍void与void*区别及注意事项的博文
- 创建自己的linq类