博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Custom checkout cart – How to send email after successful checkout
阅读量:4202 次
发布时间:2019-05-26

本文共 966 字,大约阅读时间需要 3 分钟。

Custom checkout cart – How to send email after successful checkout

Recently I have been working on a custom checkout page for one of our clients in Sweden. I had some trouble figuring out how to send default Magento order email with all of the order info. After an hour or so of studying Magento core code, here is the solution on how to send email after successful order has been made.

 

1
2
3
4
5
6
7
8
9
10
11
< ?php
$order
=
new
Mage_Sales_Model_Order();
$incrementId
= Mage::getSingleton(
'checkout/session'
)->getLastRealOrderId();
 
$order
->loadByIncrementId(
$incrementId
);
 
try
{
$order
->sendNewOrderEmail();
}
catch
(Exception
$ex
) {  }
?>

Not sure how useful this alone will be for you, so I’ll throw a little advice along the way. When trying to figure how to reuse Magento code, separate some time to study the Model classes with more detail. Then “tapping into” and reusing some of them should be far more easier.

Cheers…

转载地址:http://rjcli.baihongyu.com/

你可能感兴趣的文章
欢迎加入【亿能测试快讯】邮件列表!
查看>>
为什么我们的自动化测试“要”这么难
查看>>
LoadRunner性能脚本开发实战训练
查看>>
测试之途,前途?钱途?图何?
查看>>
测试设计与测试项目实战训练
查看>>
HP Sprinter:敏捷加速器
查看>>
单元测试培训PPT
查看>>
adb常用命令
查看>>
通过LR监控Linux服务器性能
查看>>
通过FTP服务的winsockes录制脚本
查看>>
LRwinsocket协议测试AAA服务器
查看>>
Net远程管理实验
查看>>
反病毒专家谈虚拟机技术 面临两大技术难题
查看>>
几种典型的反病毒技术:特征码技术、覆盖法技术等
查看>>
性能测试一般过程与LR性能测试过程
查看>>
Software Security Testing软件安全测试
查看>>
SQL注入漏洞全接触--进阶篇
查看>>
SQL注入漏洞全接触--高级篇
查看>>
SQL注入法攻击一日通
查看>>
菜鸟入门级:SQL注入攻击
查看>>