[英]Magento email success message after form submission returns blank page
I used the a tutorial to make a contact form module in Magento: 我使用了一个教程在Magento中制作联系表单模块:
However, the way he describes how to output a success message doesn't work. 但是,他描述如何输出成功消息的方式不起作用。 Or I'm doing it wrong. 还是我做错了。 I figured I could just: 我想我可以:
Mage::getSingleton('core/session')->addSuccess('Success!');
But that just results in a blank page. 但这只会导致空白页。
Does anyone know a way I could display a success message within the code outlined in the site above? 有谁知道我可以在上面站点中概述的代码内显示成功消息的方法?
Thanks! 谢谢!
Try customer/session
instead of core/session
. 尝试使用customer/session
而不是core/session
。 Also make sure to append a redirect to your code: 另外,请确保将重定向附加到您的代码:
Mage::getSingleton('customer/session')->addSuccess('Success!');
$this->_redirect('your-url/');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.